首页 前端知识 成功解决 npm ERR! ERESOLVE could not resolve

成功解决 npm ERR! ERESOLVE could not resolve

2024-04-29 11:04:04 前端知识 前端哥 454 347 我要收藏

解决方法

执行下面装包语句

npm i --legacy-peer-deps

错误日志

E:\kuaijie\employment-service\kj-ui>npm install
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: html-webpack-plugin@5.5.0
npm ERR! Found: webpack@4.46.0
npm ERR! node_modules/webpack
npm ERR!   peer webpack@"^4.0.0" from @intervolga/optimize-cssnano-plugin@1.0.6
npm ERR!   node_modules/@intervolga/optimize-cssnano-plugin
npm ERR!     @intervolga/optimize-cssnano-plugin@"^1.0.5" from @vue/cli-service@4.4.6
npm ERR!     node_modules/@vue/cli-service
npm ERR!       dev @vue/cli-service@"4.4.6" from the root project
npm ERR!       4 more (@vue/cli-plugin-babel, @vue/cli-plugin-eslint, ...)
npm ERR!   peer webpack@"^4.0.0 || ^5.0.0" from @soda/friendly-errors-webpack-plugin@1.8.1
npm ERR!   node_modules/@soda/friendly-errors-webpack-plugin
npm ERR!     @soda/friendly-errors-webpack-plugin@"^1.7.1" from @vue/cli-service@4.4.6
npm ERR!     node_modules/@vue/cli-service
npm ERR!       dev @vue/cli-service@"4.4.6" from the root project
npm ERR!       4 more (@vue/cli-plugin-babel, @vue/cli-plugin-eslint, ...)
npm ERR!   22 more (@vue/cli-plugin-babel, @vue/cli-plugin-eslint, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer webpack@"^5.20.0" from html-webpack-plugin@5.5.0
npm ERR! node_modules/html-webpack-plugin
npm ERR!   dev html-webpack-plugin@"^5.5.0" from the root project
npm ERR!   peer html-webpack-plugin@">=2.26.0" from @vue/preload-webpack-plugin@1.1.2
npm ERR!   node_modules/@vue/preload-webpack-plugin
npm ERR!     @vue/preload-webpack-plugin@"^1.1.0" from @vue/cli-service@4.4.6
npm ERR!     node_modules/@vue/cli-service
npm ERR!       dev @vue/cli-service@"4.4.6" from the root project
npm ERR!       4 more (@vue/cli-plugin-babel, @vue/cli-plugin-eslint, ...)
npm ERR!
npm ERR! Conflicting peer dependency: webpack@5.87.0
npm ERR! node_modules/webpack
npm ERR!   peer webpack@"^5.20.0" from html-webpack-plugin@5.5.0
npm ERR!   node_modules/html-webpack-plugin
npm ERR!     dev html-webpack-plugin@"^5.5.0" from the root project
npm ERR!     peer html-webpack-plugin@">=2.26.0" from @vue/preload-webpack-plugin@1.1.2
npm ERR!     node_modules/@vue/preload-webpack-plugin
npm ERR!       @vue/preload-webpack-plugin@"^1.1.0" from @vue/cli-service@4.4.6
npm ERR!       node_modules/@vue/cli-service
npm ERR!         dev @vue/cli-service@"4.4.6" from the root project
npm ERR!         4 more (@vue/cli-plugin-babel, @vue/cli-plugin-eslint, ...)
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 C:\Users\47937\AppData\Local\npm-cache\eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\47937\AppData\Local\npm-cache\_logs\2023-06-21T02_05_29_525Z-debug-0.log

背景:

        在执行npm install时报错,用上面的语句重新执行就可以了。

参考链接:

npm ERR ERESOLVE could not resolve(npm 装包报错)_徐同保的博客-CSDN博客

转载请注明出处或者链接地址:https://www.qianduange.cn//article/6124.html
标签
评论
发布的文章

qt JSON和字符串相互转换

2024-05-05 12:05:04

nlohmann::json从入门到精通

2024-05-05 12:05:00

Android-第十节JSON讲解

2024-05-05 12:05:35

FastJson 框架详解

2024-05-05 12:05:31

MySql操作JSON

2024-05-05 12:05:31

大家推荐的文章
会员中心 联系我 留言建议 回顶部
复制成功!