解决VUE-npm ERR! C:\rj\node-v14.4.0-win-x64\nod问题
目录
- VUE-npm ERR! C:\rj\node-v14.4.0-win-x64\nod
- While resolving: vue-admin-template@3.8.0 npm ERR! Found: node-sass@6.0.1 npm ERR! node_modules/nod
- 总结
VUE-npm ERR! C:\rj\node-v14.4.0-win-x64\nod
错误
解决办法
- 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:\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
总结
以上为个人经验,希望能给大家一个参考,也希望大家多多支持代码部落。
本文章来源于网络,作者是:@幻影忍者,由代码部落进行采编,如涉及侵权请联系删除!转载请注明出处:https://daimabuluo.cc/JavaScript/2242.html