npm install 报错
While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/node-sass
npm ERR! dev node-sass@"^6.0.1" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer node-sass@"^4.0.0" from [email protected]
npm ERR! node_modules/sass-loader
npm ERR! dev sass-loader@"6.0.7" 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 E:\node\node_cache\eresolve-report.txt for a full report.
解决办法
我的node.js版本是16.18.1
在项目目的package.json文件把 node-sass 和 sass-loader 的修改成如下版本
node-sass:^6.0.1
sass-loader:^6.0.7
在命令后面加上:–legacy-peer-deps
npm install --legacy-peer-deps