The solution to the failure of npm to install node-sass, node-zopfli and other modules

When installing this thing, there will be lazy pyathon2.7, it must be 2.7 and other versions are not enough, and then you need to rely on lazy visual studio (20GB is required for installation).

In fact, just set an environment variable

Looking at the error log, you will find that there is a file download failure, similar to this file name win32-x64-51_binding.node.

Then go to https://github.com/sass/node-sass/releases/v3.13.1/ or download it manually from the mirror of Taobao

Finally set the environment variable



 

But this does not solve the problem of npm install error reporting

To completely solve the problem, you need to install the VC++ compilation environment, you can use the following command

npm install --global --production windows-build-tool
This command will automatically install python27 and vc++ runtime environment or download visual studio2017 and python27 and install it yourself

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326021280&siteId=291194637