

If the pull binding.node fails, node sass will try to compile the binding.node locally, which requires python. Reason 6: prompt that python is not installed, build fails, etc At this time, NPM uninstall node sass or manually delete the original directory before installing. You may not have permission to delete the installed content. Reason 5: reinstall after installation failure Follow the prompts NPM rebuild node sass or clear the cache and reinstall. This is because the original binding.node cache is not consistent with the current node version. If the local node version changes, or runs on different machines, and the node versions are inconsistent, a similar error will be reported: Found bindings for the following environments: Reason 4: the binding.node version in the cache is inconsistent At this time, the version of node sass or node can be changed. Therefore, if the version of node sass is not compatible with that of node, the corresponding binding.node will not be found and an error will be reported. Its version number can be found in process.versions: PS D:\demo> nodeĪs shown above, the module version of node10.15.3 is 64. You can see that it includes node sass version number v4.13.0, platform Win32, architecture 圆4, and Node Module version 64. In the example at the beginning of this article, the version of binding.node is v4.13.0/win32-圆4-64_binding.node. The corresponding version is as follows (or refer to Official warehouse): NodeJS The old project depends on node sass which may not be compatible with the new node. The compatibility of node sass version is not good. npmrcĮlectron_mirror= Reason 3: incompatible node version and node sass version There are also common dependency packages such as chrome driver, phantom JS, and electron. Set SASS_BINARY_SITE= & npm install node-sass

#CONDA INSTALL NODEJS WINDOWS 10 MAC#
We can also change it to a domestic source: // linux, mac The default source is github, which is slow to access in China and even cannot be accessed in special periods.
#CONDA INSTALL NODEJS WINDOWS 10 DOWNLOAD#
Node sass can download the binary file binding.node in addition to the part of npm code. Registry= Reason 2: the binding.node source cannot be accessed or is slow

npm source can be set as domestic image source (such as Taobao npm): npm config set registry Therefore, there are several reasons for the failure of node sass installation: Reason 1: npm source is slowĭue to the well-known domestic network environment, it will be very slow to install the dependency package from the official source in China. It can be seen that node sass actually relies on a binary file, binding.node, which will be downloaded from github after the ontology is installed from the npm source. Write the version information to package-lock.json.If the downloading of binding.node fails, try to compile the file locally.Without binding.node, download the binary file from github and cache it to the global.Check whether there is binding.node in the global cache and local cache, and skip the installation if there is.If not installed or the version is incorrect, install the node sass ontology from the npm source.Verify whether node sass is installed in local node modules and whether the versions are consistent.+ 174 packages from 138 contributors and audited 529 packages in 24.379sĪs we can see, there are several steps to install node sass: Npm notice created a lockfile as package-lock.json. > postinstall D:\demo\node_modules\node-sassīinary found at D:\demo\node_modules\node-sass\vendor\win32-圆4-64\binding.node > install D:\demo\node_modules\node-sassīinary saved to D:\demo\node_modules\node-sass\vendor\win32-圆4-64\binding.nodeĬaching binary to C:\Users\leepi\AppData\Roaming\npm-cache\node-sass\4.13.0\win32-圆4-64_binding.node Before we talk about the error reporting reasons, let's analyze the installation process of node sass (the following node version is v10.15.3): PS D:\demo> npm i node-sass Node sass is a very common dependency package in our development, and it is also the most common dependency for long installation time and error reporting.
