First I was a small white ha, the first time to play this thing, first why I want to install the Node-sass module, because do not install this module, Sass-loader will not work properly
In this way to make a nearly a day to install the Node-sass module, a variety of Google, in fact, a lot of great God said is really feasible, but as small white is not so understanding, so today to organize and share to everyone, after all, with sass to write CSS that call a word cool ah, Can save a lot of code, look at the problem below
First of all, small white encountered a problem is generally nothing, first look at our familiar report red,
Build start time is 2016/6/27 Monday 11:39:46. Node1 on the project "C:\Users\ Shimin \node_modules\node-Sass\build\binding.sln "(default target). Validatesolutionconfiguration: Building Solution Configuration "Release |x64 ". Msbuild:error MSB3428: Failed to load Visual C + + component ' VCBuild.exe '. To resolve this issue, 1) Install the. NET Framework 2.0 sdk;2) to install Microsoft Visual Studio 2005, or 3) if the component is installed in a different location, add its location to the system path. [C:\Users\ shimin \node_modules\node- Sass\build\binding.sln] completed build project C:\Users\ Shimin \node_modules\node-sass\build\binding.sln "(default target) action-failed. Build failed. "C:\Users\ Shimin \node_modules\node-sass\build\binding.sln "(Default target) (1)(_src_\libsass target)-Msbuild:error MSB3428: Failed to load Visual C+ + component "VCBuild.exe". To resolve this issue, 1) Install the. NET Framework 2.0 sdk;2) to install Microsoft Visual Studio 2005, or 3If you installed the component to a different location, add its location to the system path. [C:\Users\ shimin \node_modules\node-Sass\build\binding.sln]0a warning1 errors
Then, on a race to VC + + components, install a variety of useless things, tried various solutions, and finally there is no way to carefully look at the error message from beginning to end, and then after node scripts/install.js found such a sentence
Cannot download "Https://github.com/sass/node-sass/releases/download/v3.8.0/win32-x64-46_binding.node":
This sentence everyone understand Ah, I will not say, here I do not know why download failed, because my Computer global agent, normal access to any site is unimpeded, baffled,
Well then I'll download it myself (why download it yourself?) Because I also found in Google when writing useful things, although not so intuitive, but also gave me a lot of help)
After downloading it, register it as a global environment variable in two ways:
The first: Right-click My Computer--"Properties--" Advanced system settings--"environment variable--" add
The second type: Set xxx= file Path--"Set Sass_binary_path=f:\lishiming\tools\node-sass\win32-x64-46_binding.node
See if the environment is right: Echo%sass_binary_path%
If you print out your configured file address then OK,
Finally, try the installation: NPM i-g Node-sass
Perfect solution
!
Recently in the study of Webpack to build the project, saying that installing the Node-sass module is a problem