node-sass 模块报错、老是安装不上?
Syntax Error: Error: Missing binding D:\code\xxxx\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 Unsupported runtime (93)
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.
node-sass这个模块很坑爹,一直报错安装不上,试了各种办法。
用了npm install 、cnpm install 、yarn install 都不行。
后来发现是node-sass模块对node版本有兼容性,版本不适配,就容易报错。
下图是node-sass和 node的对应的版本
编辑
如果切换node版本后,仍然报错,尝试重新构建下 node-sass模块
在项目目录下打开cmd:
输入命令: npm rebuild node-sass
然后再更新一下:npm update
或者删除原先的node-pass,然后cnpm install node-pass 都可以
看下效果,运行顺利
编辑