当前位置: 首页 > news >正文

npm install 报错

npm install 报错

npm install 报错

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: yudao-ui-admin@1.8.0-snapshot
npm ERR! Found: eslint@7.15.0
npm ERR! node_modules/eslint
npm ERR!   dev eslint@"7.15.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer eslint@">= 1.6.0 < 7.0.0" from @vue/cli-plugin-eslint@4.5.18
npm ERR! node_modules/@vue/cli-plugin-eslint
npm ERR!   dev @vue/cli-plugin-eslint@"4.5.18" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR!
npm ERR! For a full report see:
npm ERR! C:\Users\HX\AppData\Local\npm-cache\_logs\2023-08-30T14_59_25_161Z-eresolve-report.txtnpm ERR! A complete log of this run can be found in: C:\Users\HX\AppData\Local\npm-cache\_logs\2023-08-30T14_59_25_161Z-debug-0.logD:\WorkSpace\ruoyi-vue-pro\yudao-ui-admin>npm cache clear --forc
npm WARN using --force Recommended protections disabled.

解决方案:

npm install --legacy-peer-deps

不支持nodejs 18 报错

npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@achrinza/node-ipc@9.2.2',
npm WARN EBADENGINE   required: { node: '8 || 10 || 12 || 14 || 16 || 17' },
npm WARN EBADENGINE   current: { node: 'v18.17.1', npm: '9.6.7' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'pkcs7@0.2.3',
npm WARN EBADENGINE   required: { npm: '^1.4.6', node: '^0.10' },
npm WARN EBADENGINE   current: { node: 'v18.17.1', npm: '9.6.7' }
npm WARN EBADENGINE }

解决方案:

在package-lock.json文件中修改

      "engines": {"node": "8 || 10 || 12 || 14 || 16 || 17 || 18"}

在package.json可能需要添加属性 .
SET NODE_OPTIONS=–openssl-legacy-provider

  "scripts": {"local": "SET NODE_OPTIONS=--openssl-legacy-provider &&  vue-cli-service serve --mode local","dev": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --mode dev","front": "vue-cli-service serve --mode front","build:prod": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build --mode prod","build:stage": "vue-cli-service build --mode stage","build:dev": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build --mode dev","build:static": "vue-cli-service build --mode static","preview": "node build/index.js --preview","lint": "eslint --ext .js,.vue src","clean": "rimraf node_modules"},

直接启动
npm run dev

> yudao-ui-admin@1.8.0-snapshot dev
> SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --mode devBrowserslist: caniuse-lite is outdated. Please run:npx update-browserslist-db@latestWhy you should do it regularly: https://github.com/browserslist/update-db#readmeINFO  Starting development server...
98% after emitting CopyPluginDONE  Compiled successfully in 29648ms                                                                                                                                                                                       23:20:59App running at:- Local:   http://localhost:81/- Network: http://192.168.1.102:81/
http://www.lryc.cn/news/147618.html

相关文章:

  • 专业人士使用的3个好用的ChatGPT提示
  • doris系列2: doris分析英国房产数据集
  • 精准运营,智能决策!解锁天翼物联水利水务感知云
  • CleanMyMac最新版4.14Mac清理软件下载安装使用教程
  • String.Format方法详解
  • 【Mysql】关联查询1对多处理
  • vue 入门案例模版
  • el-select实现懒加载
  • Java泛型机制
  • Linux CentOS安装抓包解包工具Wireshark图形化界面
  • 虹科分享 | 温度边缘效应对冻干成品含水量的影响(下)——优化和总结
  • ATF(TF-A)安全通告 TFV-1 (CVE-2016-10319)
  • 说说我最近筛简历和面试的感受。。
  • Mysql /etc/my.cnf参数详解(一)
  • 用最少数量的箭引爆气球【贪心算法】
  • Matlab论文插图绘制模板第109期—特征渲染的标签气泡散点图
  • 音视频 ffplay命令播放媒体
  • 使用Fiddler模拟网络
  • 【Axure高保真原型】多图表动态切换
  • 笔试题-访问控制修饰符范围
  • 基于飞腾芯片的设计与调试入门指导
  • 了解 HarmonyOS
  • 【校招VIP】产品面试之面试官的真实意图
  • 实现远程访问Linux堡垒机:通过JumpServer系统进行安全的服务器管理
  • Go 1.21新增的 maps 包详解
  • 《向量数据库指南》——腾讯云向量数据库(Tencent Cloud VectorDB) SDK 正式开源
  • Tutorial: Mathmatical Derivation of Backpropagation
  • 如何在 Linux 中设置 SSH 无密码登录
  • 什么时候用增量式PID,什么时候用位置式PID
  • Go语言入门记录:从基础到变量、函数、控制语句、包引用、interface、panic、go协程、Channel、sync下的waitGroup和Once等