【问题标题】:npm peerDependency version conflictnpm peerDependency 版本冲突
【发布时间】: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


【解决方案1】:

最近我遇到了一个熟悉的问题。

尝试使用节点 14.x.x

一堆依赖项只是在节点 LTS(今天的 v14.17.3)中运行。话虽如此,也许这个依赖不能在节点 v16.4.0 中运行。

我认为这会解决。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-06-28
    • 2023-03-23
    • 2019-08-07
    • 2015-11-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多