如何解决npm peerDependency 版本冲突
我正在运行 npm install
,但出现此错误:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: my-project@0.1.0
npm ERR! Found: @cxx/jxx-xxxxx@0.0.9
npm ERR! node_modules/@cxx/jxx-xxxxx
npm ERR! @cxx/jxx-xxxxx@"0.0.9" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @cxx/jxx-xxxxx@"^0.0.8" from @cxx/cxx-util@0.10.7
npm ERR! node_modules/@cxx/cxx-util
npm ERR! @cxx/cxx-util@"^0.10.7" 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! See /Users/cxx/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
“0.0.9”不满足“^0.0.8”吗?有点乱……
我的 npm 版本是 v7.18.1,而 node 版本是 v16.4.0,在 MacOS Big Sur 11.4 上。
谢谢。
解决方法
最近我遇到了一个熟悉的问题。
尝试使用节点 14.x.x
一堆依赖项只是在节点 LTS(今天的 v14.17.3)中运行。话虽如此,也许这个依赖不能在 node v16.4.0 中运行。
我认为这会解决。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。