【发布时间】:2021-07-06 21:02:29
【问题描述】:
我正在运行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”吗?很混乱……
在 MacOS Big Sur 11.4 上,我的 npm 版本是 v7.18.1,而节点版本是 v16.4.0。
谢谢。
【问题讨论】:
-
带有--force 或--legacy-peer-deps 的命令有效,但我只想知道为什么“0.0.9”和“^0.0.8”之间存在冲突。
npm install命令会自动安装对等依赖项吗?如果不是,npm 怎么会抛出对等依赖冲突的错误并退出进程呢?
标签: npm installation conflict semantic-versioning