node版本升级后vue项目启动错误(node-sass sass-loader)

在升级完node版本后启动项目发现报错,这是由于版本兼容导致的,关键报错如下:

Downloading binary from https://npm.taobao.org/mirrors/node-sass/v4.12.0/win32-x64-93_binding.node
Cannot download "https://npm.taobao.org/mirrors/node-sass/v4.12.0/win32-x64-93_binding.node": 

HTTP error 404 Not Found

Hint: If github.com is not accessible in your location
      try setting a proxy via HTTP_PROXY, e.g. 

      export HTTP_PROXY=http://example.com:1234

or configure npm proxy via

      npm config set proxy http://example.com:8080
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@4.12.0 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@4.12.0 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Administrator\AppData\Roaming\npm-cache\_logs\2022-06-15T13_59_40_556Z-debug.log

以前的版本信息:

在这里插入图片描述
以前我的node版本为:v14.5.1

又去看了下nodesass-node的版本对应表

在这里插入图片描述
可以看到前面是没问题的,但是我现在node版本升级为了:v16.15.1

所以node-sass就必须要6.0+的版本才行

还得去看node-sasssass-loader的对应版本,把sass-loader也换为对应的版本

我这里v16.15.1需要的版本:

npm install node-sass@6.0.1 sass-loader@10.2.0

版本更换完成,问题解决。

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

温情key

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值