Node Sass could not find a binding for your current environment: Windows 64-bit with Node.js 14.x

 ERROR  Failed to compile with 8 errors                                                                                          上午8:54:34
 error  in ./src/styles/index.scss

Module build failed (from ./node_modules/sass-loader/lib/loader.js):
Error: Missing binding E:\BaiduNetdiskDownload\tool\vue-admin-template-master\node_modules\node-sass\vendor\win32-x64-83\binding.node
Node Sass could not find a binding for your current environment: Windows 64-bit with Node.js 14.x

Found bindings for the following environments:
  - Windows 64-bit with Node.js 10.x

This usually happens because your environment has changed since running `npm install`.
Run `npm rebuild node-sass` to download the binding for your current environment.
    at module.exports (E:\BaiduNetdiskDownload\tool\vue-admin-template-master\node_modules\node-sass\lib\binding.js:15:13)
    at Object.<anonymous> (E:\BaiduNetdiskDownload\tool\vue-admin-template-master\node_modules\node-sass\lib\index.js:14:35)
    at Module._compile (internal/modules/cjs/loader.js:1072:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
    at Module.load (internal/modules/cjs/loader.js:937:32)
    at Function.Module._load (internal/modules/cjs/loader.js:778:12)
    at Module.require (internal/modules/cjs/loader.js:961:19)
    at require (internal/modules/cjs/helpers.js:92:18)
    at Object.sassLoader (E:\BaiduNetdiskDownload\tool\vue-admin-template-master\node_modules\sass-loader\lib\loader.js:24:22)

 @ ./src/styles/index.scss 4:14-203 14:3-18:5 15:22-211
 @ ./src/main.js
 @ multi (webpack)-dev-server/client?http://localhost:9528 (webpack)/hot/dev-server.js ./src/main.js

大概错误是

Node Sass could not find a binding for your current environment: Windows 64-bit with Node.js 14.x

Found bindings for the following environments:

  • Windows 64-bit with Node.js 10.x

就是sass不适用Node.js 14.x的版本

查看package.json

在这里插入图片描述

查看node与node-sass版本对应关系

https://www.npmjs.com/package/node-sass
在这里插入图片描述
从图可以看到Node14对应sass4.14+

第一种解决方案,npm中安装

首先改掉package.json中对应的node-sass的版本号,再执行以下两条命令

npm install -g node-gyp
npm install node-sass

第二种

执行下面两条命令

npm rebuild node-sass
npm update
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值