I am having issues building an app because node-sass keeps failing with the error.
ERROR in Missing binding /Users/warren/Sites/random-docs/my-cms/nod
* Docker related answer here *
Answer for if you are seeing this problem, or something similar, and are using Docker.
Cause: When copying over the current file structure to inside the Docker container, you may be copying over node modules from one OS system to another (e.g. a Mac to Linux container).
Solution:
Add a .dockerignore
, and inside add:
node_modules
This will cause an npm install
to install the bindings for the docker environment, rather than your local machine environment.
Note I'm using VS 2015, 64-bit Windows 7.
Also works for VS 2017 and VS 2019 (from replies to this post)
Task Runner Explorer can't load tasks
For VS 2015
For VS 2017(.3)
In VS 2017 & 2019, you also need to put $(PATH) above $(VSINSTALLERDIR)\Web\External
Deleting node_modules
and running npm install
and then npm rebuild node-sass
did nothing.
I had the same problem
throw new Error(errors.missingBinary());
^
Error: Missing binding /path/to/project/node_modules/node-sass/vendor/linux-x64-47/binding.node
Node Sass could not find a binding for your current environment: Linux 64-bit with Node.js 5.x
Found bindings for the following environments:
- Linux 64-bit with Node 0.10.x
- Linux 64-bit with Node.js 5.x
That was because I did npm install using a different nodejs version, try deleting node_modules folder installing and starting
cd your_project
rm -rf node_modules
npm install
npm start or gulp or whatever
If you are using nvm do
nvm use stable // or your favorite version
// remove node_module directory
npm install
npm start or gulp or whatever
Just refresh your npm cache and:
npm cache clean --force
npm install
It always works for me in the same case.
UPD: Your problem may also be by reason of absence of a global sasslib.
npm install -g sass
This usually happens because the environment has changed since running npm install
.
Running npm rebuild node-sass
builds the binding for the current environment.
I had a similar problem and the reason was that there were two versions of Node installed in my machine: one "global" and another one at the project level. Sass will build correctly only if the Gulp build is running under Node.js 4.x version, so make sure you upgrade the version of Node you are using.
PS: If you completely remove the node_modules folder in your project and re-build from scratch, npm will download the correct dependencies for your current system & node version.