Currently, the current node-sass 3.4.2 does not contain binaries in the originally downloaded npm package (as shown in the npm package cache in ~/.npm ).
What he does is that his install.js script will download the binary for the platform and save it under vendor/{platform}-{arch}-{process.versions.module}.node . After installation, the install.js script is usually not called again by npm.
Therefore, when you go into node_modules , it will contain a binary file only for your initial platform.
For fun, I moved the downloaded binary, which should be the same as someone else checking your node_modules on a different platform. When this is done, node-sass is smart enough to detect that the required binary does not exist. It exits gracefully, recommending running npm rebuild node-sass (also hinting that this is usually necessary when changing the version of node). This will download the binary for the current platform, and then everything will be fine.
However, which is completely specific for node-sass, other packages with binary files may behave completely differently.
(see Node.js version release for an explanation of process.versions.modules aka. NODE_MODULES_VERSION, which defines the last number in a binary URL load. The binary name is built in function getBinaryName() in ~ / .npm / node-sass / {version} / package.tgz / lib / extension.js)
jfrantzius Feb 23 '16 at 21:14 2016-02-23 21:14
source share