编辑
2024-04-17
开发
00

目录

解决办法
1、使用 --force 或 --legacy-peer-deps 参数重新运行 npm 安装命令:
2、手动解决依赖冲突:
3、清除 npm 缓存并重新安装依赖:

code ERESOLVE

npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree npm ERR! npm ERR! While resolving: admin.net@2.4.33

Node项目在安装Modules 的时候出现以下问题可能是依赖包检测到冲突导致的

npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree npm ERR! npm ERR! While resolving: admin.net@2.4.33 npm ERR! Found: eslint@9.0.0 npm ERR! node_modules/eslint npm ERR! dev eslint@"^9.0.0" from the root project npm ERR! npm ERR! Could not resolve dependency: npm ERR! peer eslint@"^8.56.0" from @typescript-eslint/parser@7.7.0 npm ERR! node_modules/@typescript-eslint/parser npm ERR! dev @typescript-eslint/parser@"^7.6.0" from the root project npm ERR! peer @typescript-eslint/parser@"^7.0.0" from @typescript-eslint/eslint-plugin@7.7.0 npm ERR! node_modules/@typescript-eslint/eslint-plugin npm ERR! dev @typescript-eslint/eslint-plugin@"^7.6.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! See /Users/mac/.npm/eresolve-report.txt for a full report. npm ERR! A complete log of this run can be found in:

解决办法

1、使用 --force 或 --legacy-peer-deps 参数重新运行 npm 安装命令:

css
npm install --force

css
npm install --legacy-peer-deps

这两个参数可以让 npm 忽略依赖冲突并继续安装,但这可能会导致你的项目出现潜在的依赖问题,因此请谨慎使用。

2、手动解决依赖冲突:

可以手动修改 package.json 文件,将依赖版本修改为符合要求的版本,然后重新运行 npm 安装命令。

3、清除 npm 缓存并重新安装依赖:

npm cache clean --force npm install

清除 npm 缓存并重新安装依赖可能会解决一些依赖问题。

本文作者:SnailBoy

本文链接:

版权声明:本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!