webpack npm install命令显示错误消息太多

nwo49xxi  于 2022-11-13  发布在  Webpack
关注(0)|答案(1)|浏览(125)

我需要通过运行以下命令在项目中安装节点:

npm install

但在运行此命令后,我得到此错误消息:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR! 
npm ERR! While resolving: browser-sync-webpack-plugin@2.0.1
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.5.17
npm ERR!     node_modules/@vue/cli-service
npm ERR!       dev @vue/cli-service@"~4.5.13" from the root project
npm ERR!       5 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.5.17
npm ERR!     node_modules/@vue/cli-service
npm ERR!       dev @vue/cli-service@"~4.5.13" from the root project
npm ERR!       5 more (@vue/cli-plugin-babel, @vue/cli-plugin-eslint, ...)
npm ERR!   28 more (@vue/cli-plugin-babel, @vue/cli-plugin-eslint, ...)
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer webpack@"^1 || ^2 || ^3" from browser-sync-webpack-plugin@2.0.1
npm ERR! node_modules/browser-sync-webpack-plugin
npm ERR!   browser-sync-webpack-plugin@"2.0.1" from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: webpack@3.12.0
npm ERR! node_modules/webpack
npm ERR!   peer webpack@"^1 || ^2 || ^3" from browser-sync-webpack-plugin@2.0.1
npm ERR!   node_modules/browser-sync-webpack-plugin
npm ERR!     browser-sync-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! See /Users/hello/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/hello/.npm/_logs/2022-10-06T12_31_49_438Z-debug-0.log

请告诉我为什么会显示此错误信息,以及如何解决此问题?

rqenqsqc

rqenqsqc1#

运行npm install --legacy-peer-deps
此问题已得到回答here

相关问题