简体   繁体   中英

Cannot download node-sass binding

If you're using node-sass you might get an error message like this when running npm install :

Downloading binary from https://github.com/sass/node-sass/releases/download/v4.13.1/win32-x64-83_binding.node
Cannot download "from https://github.com/sass/node-sass/releases/download/v4.13.1/win32-x64-83_binding.node": 

HTTP error 404 Not Found

The cause of this issue is that in Node there's a concept called ABI (Application Binary Interface) which determines which native modules work with which versions of Node. Since node-sass contains native parts it requires bindings to make it work with different versions of Node. When trying to run npm install the installation fails when attempting to download a binding for your version of Node - which has a too high ABI version. In other words there is no binding for that ABI for node-sass

To solve this:

  1. Uninstall Node
  2. Compare ABI in the list at https://nodejs.org/en/download/releases/ and the mappings available at https://github.com/sass/node-sass/releases for the specific release that you're using
  3. Download and install the latest version of Node which supports your version of node-sass
  4. Delete the node_modules folder and run npm install

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM