NPM restore attempting to retrieve non-existent node-sass

Viewed 374

I'm trying to understand how NPM is coming up with this specific non-existent URL to retrieve node-sass.

My package.json includes:

  "dependencies": {
    "node-sass": "<=4.5.3",
    "request": "<=2.81.0",
    "shrinkwrap": "^0.4.0"
  },

From VS2019 I perform a restore on the package.json. One of the first things it tries to install is node-sass, but it generates a request for a release asset that doesn't exist:

> node-sass@4.5.3 install C:\Dev\LegacyProject\Dev\LegacyProject.Web\node_modules\node-sass
> node scripts/install.js
Downloading binary from https://github.com/sass/node-sass/releases/download/v4.5.3/win32-x64-72_binding.node
Cannot download "https://github.com/sass/node-sass/releases/download/v4.5.3/win32-x64-72_binding.node": 
HTTP error 404 Not Found

This release exists, but in the assets of that release there is no asset with a "-72" for this release: win32-x64-72_binding.node: https://github.com/sass/node-sass/releases/tag/v4.5.3

What does this "-72" specify in the asset naming convention?
Why would it be trying to install a non-existent release asset? In other words, how does it come up with this specific URL?

1 Answers

The suffixes like -72 relate to the Node version for which that binary was built, per e.g. https://github.com/sass/node-sass#node-version-support-policy:

NodeJS Supported node-sass version Node Module
Node 16 6.0+ 93
Node 15 5.0+ 88
Node 14 4.14+ 83
Node 13 4.13+, <5.0 79
Node 12 4.12+ 72
Node 11 4.10+, <5.0 67
Node 10 4.9+, <6.0 64
Node 8 4.5.3+, <5.0 57
Node <8 <5.0 <57

If it's trying to download -72 you're presumably using Node 12, which doesn't have a pre-compiled binary for node-sass@4.5.3.

You can see more about this Node Module version on e.g. https://nodejs.org/en/download/releases/, which says:

NODE_MODULE_VERSION refers to the ABI (application binary interface) version number of Node.js, used to determine which versions of Node.js compiled C++ add-on binaries can be loaded in to without needing to be re-compiled. It used to be stored as hex value in earlier versions, but is now represented as an integer.

Related