首页 > 代码库 > node-sass安装失败解决方法
node-sass安装失败解决方法
报错信息:
Missing binding E:\webstorm\notepad\notepad\node_modules\node-sass\vendor\win32-x64-46\binding.node
Node Sass could not find a binding for your current environment: Windows 64-bit with Node.js 4.x
Found bindings for the following environments:
- Windows 64-bit with Node.js 6.x
This usually happens because your environment has changed since running `npm install`.
Run `npm rebuild node-sass` to build the binding for your current environment.
@ ./~/vue-style-loader!./~/css-loader!./~/vue-loader/lib/style-rewriter.js?id=data-v-7931a4ec!./~/sass-loader!./~/vue-loader/lib/selector.js?type=styles&index=0!./src/App.vue 4:14-240 13:2-17:4 14:20-246
解决方法:
转自:http://blog.csdn.net/zhu1500527791/article/details/53444870
Cannot download "https://hithub.com/sass/node-sass/releases/download/v3.13.0/win32-x64-46_binding.node"
- 1
从上图第九行代码可以看出,导致node-sass
安装失败的原因是因为无法下载.node
文件,解决办法就很简单了,就是我们把文件下载路径复制一份到浏览器里,然后使用浏览器下载文件就可以了。
具体方法
1.从node命令行中复制.node
文件下载链接并在浏览器打开下载文件
https://github.com/sass/node-sass/releases/download/v3.13.0/win32-x64-46_binding.node
- 1
2.文件下载成功后,在命令行工具输入下面指令:
set SASS_BINARY_PATH=D:/WorkCode/win32-x64-46_binding.node //PATH=后面是的下载的.node所在的路径
- 1
设置SASS_BINARY_PATH
环境变量,目的是告诉程序直接使用本地的.node文件,无需从网上下载
3.配置完成,从新输入指令:
npm i node-sass -D --verbose
- 1
接下来你就会发现node-sass安装成功。
node-sass安装失败解决方法