報錯信息:
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安裝成功。