node/node-sass/sass-loader版本不匹配引起的错误npm ERR code ERESOLVE npm ERR ERESOLVE unable to resolve

新电脑配置vscode项目环境

项目install或者run运行时,可能会报错npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree

或者报错npm ERR! code 1 npm ERR!

琢磨了老半天才发现是版本不匹配的问题,不太记得具体步骤了,大概方法

1、卸载16版本的nodejs,安装官网14的旧版本

2、卸载sass/使用淘宝镜像安装sass

3、分别重新安装两个sass,版本号参考

"node-sass": "^4.14.0" ,  "sass-loader": "^7.1.0",

npm ERR! code ERESOLVE npm ERR! ERESOLVE could not resolve npm ERR! npm ERR! While resolving: sass-loader@10.5.2 npm ERR! Found: webpack@4.28.4 npm ERR! node_modules/webpack npm ERR! peer webpack@">=2" from babel-loader@8.2.2 npm ERR! node_modules/babel-loader npm ERR! babel-loader@"^8.0.5" from @vue/cli-plugin-babel@3.5.3 npm ERR! node_modules/@vue/cli-plugin-babel npm ERR! dev @vue/cli-plugin-babel@"3.5.3" from the root project npm ERR! peer webpack@"^4.0.0" from cache-loader@4.1.0 npm ERR! node_modules/cache-loader npm ERR! cache-loader@"^4.1.0" from @vue/cli-service@4.5.11 npm ERR! node_modules/@vue/cli-service npm ERR! dev @vue/cli-service@"^4.5.9" from the root project npm ERR! 2 more (@vue/cli-plugin-vuex, @vue/cli-plugin-router) npm ERR! 22 more (copy-webpack-plugin, css-loader, eslint-loader, ...) npm ERR! npm ERR! Could not resolve dependency: npm ERR! peer webpack@"^4.36.0 || ^5.0.0" from sass-loader@10.5.2 npm ERR! node_modules/sass-loader npm ERR! dev sass-loader@"^10.2.0" from the root project npm ERR! npm ERR! Conflicting peer dependency: webpack@5.99.6 npm ERR! node_modules/webpack npm ERR! peer webpack@"^4.36.0 || ^5.0.0" from sass-loader@10.5.2 npm ERR! node_modules/sass-loader npm ERR! dev sass-loader@"^10.2.0" 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 C:\Program Files\nodejs\node_cache\eresolve-report.txt for a full report.
最新发布
04-20
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值