npm install报 ERESOLVE unable to resolve dependency tree

三四年前的一个项目,打开,npm install 一下,结果报 ERESOLVE unable to resolve dependency tree

以前install都一切顺利,现在就不行,那很大的可能是npm的版本不同。

javascript 复制代码
PS D:\workSpace\code\*-admin-ui-master> npm install
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: *-admin@0.1.0
npm ERR! Found: html-webpack-plugin@4.0.0-alpha
npm ERR! node_modules/html-webpack-plugin
npm ERR!   dev html-webpack-plugin@"4.0.0-alpha" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer html-webpack-plugin@"^3.0.0" from script-ext-html-webpack-plugin@2.0.1
npm ERR! node_modules/script-ext-html-webpack-plugin
npm ERR!   dev script-ext-html-webpack-plugin@"2.0.1" 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\11703\AppData\Local\npm-cache\_logs\2023-11-02T07_24_59_256Z-eresolve-report.txt

npm ERR! A complete log of this run can be found in: C:\Users\11703\AppData\Local\npm-cache\_logs\2023-11-02T07_24_59_256Z-debug-0.log

查看logs:

javascript 复制代码
'Log files:
C:\Users\11703\AppData\Local\npm-cache\_logs\2023-11-02T07_24_59_256Z-debug-0.log

# npm resolution error report

While resolving: *-admin@0.1.0
Found: html-webpack-plugin@4.0.0-alpha
node_modules/html-webpack-plugin
  dev html-webpack-plugin@"4.0.0-alpha" from the root project

Could not resolve dependency:
peer html-webpack-plugin@"^3.0.0" from script-ext-html-webpack-plugin@2.0.1
node_modules/script-ext-html-webpack-plugin
  dev script-ext-html-webpack-plugin@"2.0.1" from the root project

Fix the upstream dependency conflict, or retry
this command with --force or --legacy-peer-deps
to accept an incorrect (and potentially broken) dependency resolution.

给出的建议是:npm install --force 或者 --legacy-peer-deps

或者使用npx -p npm@6 npm install --legacy-peer-deps指定npm的版本。

相关推荐
逐·風3 小时前
unity关于自定义渲染、内存管理、性能调优、复杂物理模拟、并行计算以及插件开发
前端·unity·c#
Devil枫3 小时前
Vue 3 单元测试与E2E测试
前端·vue.js·单元测试
尚梦4 小时前
uni-app 封装刘海状态栏(适用小程序, h5, 头条小程序)
前端·小程序·uni-app
GIS程序媛—椰子4 小时前
【Vue 全家桶】6、vue-router 路由(更新中)
前端·vue.js
前端青山5 小时前
Node.js-增强 API 安全性和性能优化
开发语言·前端·javascript·性能优化·前端框架·node.js
毕业设计制作和分享5 小时前
ssm《数据库系统原理》课程平台的设计与实现+vue
前端·数据库·vue.js·oracle·mybatis
清灵xmf7 小时前
在 Vue 中实现与优化轮询技术
前端·javascript·vue·轮询
大佩梨7 小时前
VUE+Vite之环境文件配置及使用环境变量
前端
GDAL7 小时前
npm入门教程1:npm简介
前端·npm·node.js
小白白一枚1118 小时前
css实现div被图片撑开
前端·css