npm cannot download win32-x64-72_binding.node

When using npm to install node-sass, it depends on win32-x64-72_binding.node, but it keeps prompting "cannot download http://xxx/win32-x64-72_binding.node". There are two solutions to solve it. One is If you have a private server, you can set the SASS_BINARY_SITE environment variable to point to your own private server address. Another option is to manually download the win32 program and then install it locally by setting the SASS_BINARY_PATH environment variable.

Needless to say about installing through private servers, here we mainly introduce how to install locally.

First download the win32 program, which can be downloaded directly from the official website. The official website download address is:

node-sass download address (binding.node is something that node-sass depends on, so the download address is with it. Just download the binding.node version corresponding to node-sass)

If you cannot download it, you can download it from here: win32-x64-72_binding.node

After downloading, place it in any directory, for example: D:\win32-x64-72_binding.node

Set the system environment variable: SASS_BINARY_PATH

Open the cmd window (note that you must re-open a new cmd window, otherwise the set environment variables will not take effect), execute the command: npm i node-sass -C verbose

Then execute in the project directory: npm install

You can also refer to this article to solve the problem: vue installation node-sass prompts that there is no vendor directory and binding.node file solution_What is the binding.node file_Yiyi Ge Sun's blog-CSDN blog

Guess you like

Origin blog.csdn.net/u013992330/article/details/130863641