• 首页 首页 icon
  • 工具库 工具库 icon
    • IP查询 IP查询 icon
  • 内容库 内容库 icon
    • 快讯库 快讯库 icon
    • 精品库 精品库 icon
    • 问答库 问答库 icon
  • 更多 更多 icon
    • 服务条款 服务条款 icon

解决npm安装依赖冲突的解决办法

武飞扬头像
weixin_44244924
帮助1

npm WARN cli npm v9.6.4 does not support Node.js v14.16.0. This version of npm supports the following node versions: `^14.17.0 || ^16.13.0 || >=18.0.0`. You can find the latest version at https://nodejs.org/.
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: less-loader@4.1.0
npm ERR! Found: less@4.1.2
npm ERR! node_modules/less
npm ERR!   less@"^4.1.2" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer less@"^2.3.1 || ^3.0.0" from less-loader@4.1.0
npm ERR! node_modules/less-loader
npm ERR!   less-loader@"^4.1.0" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: less@3.13.1
npm ERR! node_modules/less
npm ERR!   peer less@"^2.3.1 || ^3.0.0" from less-loader@4.1.0
npm ERR!   node_modules/less-loader
npm ERR!     less-loader@"^4.1.0" 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\Administrator\AppData\Local\npm-cache\_logs\2023-04-14T10_08_49_684Z-eresolve-report.txt

npm ERR! A complete log of this run can be found in: C:\Users\Administrator\AppData\Local\npm-cache\_logs\2023-04-14T10_08_49_684Z-debug-0.log
学新通

安装中报错,可以在后面加 –legacy-peer-deps
学新通
安装成功。

–legacy-peer-deps标志是在v7中引入的,目的是绕过peerDependency自动安装;它告诉 NPM 忽略项目中引入的各个modules之间的相同modules但不同版本的问题并继续安装,保证各个引入的依赖之间对自身所使用的不同版本modules共存。

这篇好文章是转载于:学新通技术网

  • 版权申明: 本站部分内容来自互联网,仅供学习及演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,请提供相关证据及您的身份证明,我们将在收到邮件后48小时内删除。
  • 本站站名: 学新通技术网
  • 本文地址: /boutique/detail/tanhgfhaik
系列文章
更多 icon
同类精品
更多 icon
继续加载