VUE-npm ERR! C:rjnode-v14.4.0-win-x64nod
错误
解决办法
- node -v 查看版本
- npm config set registry https://registry.npmmirror.com 设置下载源
- npm config get registry 获取下载源
While resolving: vue-admin-template@3.8.0 npm ERR! Found: node-sass@6.0.1 npm ERR! node_modules/nod
npm install 报错
While resolving: vue-admin-template@3.8.0
npm ERR! Found: node-sass@6.0.1
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 sass-loader@6.0.7
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:nodenode_cacheeresolve-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
总结
以上为个人经验,希望能给大家一个参考,也希望大家多多支持IT俱乐部。