将项目更新到新版本后,我需要更新我的 npm。此时我想安装 npm,但是当我运行“npm i 或 npm install”时,我面临以下错误。
另外我运行“npm i --force”,但是这个命令也没有解决我的问题。
你能帮我解决这个问题吗? 我在这个项目中使用 laravel 9。
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/webpack
npm ERR! peer webpack@">=2" from [email protected]
npm ERR! node_modules/babel-loader
npm ERR! dev babel-loader@"^8.0.6" from the root project
npm ERR! babel-loader@"^8.0.4" from [email protected]
npm ERR! node_modules/laravel-mix
npm ERR! dev laravel-mix@"^4.0.7" from the root project
npm ERR! 1 more (laravel-mix-svg-sprite)
npm ERR! peer webpack@"^4.0.0" from [email protected]
npm ERR! node_modules/css-loader
npm ERR! css-loader@"^1.0.1" from [email protected]
npm ERR! node_modules/laravel-mix
npm ERR! dev laravel-mix@"^4.0.7" from the root project
npm ERR! 1 more (laravel-mix-svg-sprite)
npm ERR! peer css-loader@"*" from [email protected]
npm ERR! node_modules/vue-loader
npm ERR! vue-loader@"^15.4.2" from [email protected]
npm ERR! node_modules/laravel-mix
npm ERR! dev laravel-mix@"^4.0.7" from the root project
npm ERR! 1 more (laravel-mix-svg-sprite)
npm ERR! 15 more (dotenv-webpack, extract-text-webpack-plugin, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer webpack@"^1 || ^2 || ^3" from [email protected]
npm ERR! node_modules/browser-sync-webpack-plugin
npm ERR! dev browser-sync-webpack-plugin@"2.0.1" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: [email protected]
npm ERR! node_modules/webpack
npm ERR! peer webpack@"^1 || ^2 || ^3" from [email protected]
npm ERR! node_modules/browser-sync-webpack-plugin
npm ERR! dev 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 /home/zelda/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
我担心该软件包不再受支持,我们将不得不迁移到替代方案。然而,我尝试了几种替代方案,但没有找到令人满意的。