本文介绍: 执行下面装包语句npm ilegacypeerdeps

解决方法

执行下面装包语句

npm i --legacy-peer-deps

错误日志

E:kuaijieemploymentservicekj-ui>npm install
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: htmlwebpackplugin@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-cssnanoplugin@1.0.6
npm ERR!   node_modules/@intervolga/optimize-cssnanoplugin
npm ERR!     @intervolga/optimize-cssnanoplugin@”^1.0.5″ from @vue/cliservice@4.4.6
npm ERR!     node_modules/@vue/cliservice
npm ERR!       dev @vue/cliservice@”4.4.6″ from the root project
npm ERR!       4 more (@vue/clipluginbabel, @vue/cliplugineslint, …)
npm ERR!   peer webpack@”^4.0.0 || ^5.0.0″ from @soda/friendly-errorswebpackplugin@1.8.1
npm ERR!   node_modules/@soda/friendly-errorswebpackplugin
npm ERR!     @soda/friendly-errorswebpackplugin@”^1.7.1″ from @vue/cliservice@4.4.6
npm ERR!     node_modules/@vue/cliservice
npm ERR!       dev @vue/cliservice@”4.4.6″ from the root project
npm ERR!       4 more (@vue/cli-pluginbabel, @vue/cli-plugineslint, …)
npm ERR!   22 more (@vue/cli-pluginbabel, @vue/cli-plugineslint, …)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer webpack@”^5.20.0″ from htmlwebpack-plugin@5.5.0
npm ERR! node_modules/htmlwebpack-plugin
npm ERR!   dev htmlwebpack-plugin@”^5.5.0″ from the root project
npm ERR!   peer htmlwebpack-plugin@”>=2.26.0″ from @vue/preloadwebpack-plugin@1.1.2
npm ERR!   node_modules/@vue/preloadwebpack-plugin
npm ERR!     @vue/preloadwebpack-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 withforce, or —legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See C:Users47937AppDataLocalnpm-cacheeresolvereport.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:Users47937AppDataLocalnpm-cache_logs2023-06-21T02_05_29_525Z-debug-0.log

背景

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

参考链接

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

原文地址:https://blog.csdn.net/qq_42315633/article/details/131322199

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任

如若转载,请注明出处:http://www.7code.cn/show_42446.html

如若内容造成侵权/违法违规/事实不符,请联系代码007邮箱suwngjj01@126.com进行投诉反馈,一经查实,立即删除

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注