619
votes

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/node_modules/node-sass/vendor/darwin-x64-11/binding.node
Node Sass could not find a binding for your current environment: OS X 64-bit with Node 0.10.x

I have tried running

npm rebuild node-sass

which says

Binary is fine; exiting.

When running node -v I get v6.2.2

Which is different to what the sass error says "Node 0.10.x". I can't figure out why it is getting the wrong version. I have also tried removing the node_modules folder and running npm update or npm install, both of which did not resolve the issue. Any ideas?

30
Are you using a node version manager such as nvm? If you are sometimes it messes up some of the npm module paths and they try using a version, different that the current one. If not you could always try removing the node_modules folder and installing the dependencies againVasil Dininski
Hey im not using nvm and I tried the removal/re-install step. no luck.wazzaday
what is your development environment? you use VS.NET 2105?Mike Anderson
@VasilDininski I'm using nvm, what should I do?Subkhan Sarif
Open Visual Studio 2017 Go to Tools -> Options…Go to Projects and Solutions -> Web Package Management move $(PATH) to the top of that list and close that window. In my case this solution worked because my node version is 11.xAlreadytakenindeed

30 Answers

838
votes

I had the same problem

There is an error in your gulpfile:
Error: Missing binding E:\allapp\badshaindiancuisine\node_module\node-sass\vendor\win32-x64-46\binding.node
Node Sass could not find a binding for your current environment:Windows 64-bit with Node.js 4.x

Found bindings for the following environment:
    - OS X 64-bit with Node.js 4.x

How to solve my problem

By going into project folder and then execute:

npm rebuild node-sass
344
votes

For those that are using Visual Studio:

Currently working for VS 2015, 2017, 2019 (via below and/or replies from this post)

Task Runner Explorer can't load tasks

For VS 2015

  • Go to: Tools > Options > Projects and Solutions > External Web Tools

For VS 2017(.3) and VS 2019

  • Tools > Options > Projects and Solutions > Web Package Management > External Web Tools (per @nothrow)

In VS 2017 & 2019, you also need to put $(PATH) above $(VSINSTALLERDIR)\Web\External


  • Reorder so that $(PATH) is above $(DevEnvDir)\Extensions\Microsoft\Web Tools\External

enter image description here


Deleting node_modules and running npm install and then npm rebuild node-sass did nothing.

173
votes

Just execute: → npm rebuild node-sass --force



  1. Delete node-sass folder under node_modules
  2. npm install

In my case it also couldn't find Python.

Following procedure solved the issue (Windows):

npm rebuild node-sass --force
-- cannot find python.exe, if you have Python installed, add it to your path:
set PYTHON=C:\Python27\Python.exe
-- else: download python "Windows x86-64-MSI" installer from https://www.python.org/downloads/release/python-2714/
-- install python
-- at installation start check: add env variable to path
-- after successfull installation:
npm rebuild node-sass --force
-- finished successfully
158
votes

Worked for me:

Just delete the node-sass folder and run npm install.

148
votes

I had the same problem in a Windows environment, receiving the following error:

Error: Missing binding C:\Development{ProjectName}\node_modules\node-sass\vendor\win32-ia32-47\binding.node
Node Sass could not find a binding for your current environment: Windows 32-bit with Node.js 5.x
Found bindings for the following environments:
   - Windows 64-bit with Node.js 6.x

None of the npm commands listed in the other answers here (npm install, npm rebuild node-sass, etc.) worked.

Instead, I had to download the missing binding and place it in the appropriate destination folder.

The bindings can be found on git. Match the file with the folder name identified after /node_modules/node-sass/vendor/ in your error message ('darwin-x64-11' in your case, so you'd want the darwin-x64-11_binding.node file).

Create the missing folder in your project (/node_modules/node-sass/vendor/darwin-x64-11), copy the .node file to the new directory, and rename it to binding.node.

Node-sass release URL: https://github.com/sass/node-sass/releases

36
votes

npm rebuild node-sass --force

Or, if you are using node-sass within a container:

docker exec <container-id> npm rebuild node-sass --force

This error occurs when node-sass does not have the correct binding for the current operating system.

If you use Docker, this error usually happens when you add node_modules directly to the container filesystem in your Dockerfile (or mount them using a Docker volume).

The container architecture is probably different than your current operating system. For example, I installed node-sass on macOS but my container runs Ubuntu.

If you force node-sass to rebuild from within the container, node-sass will download the correct bindings for the container operating system.

See my repro case to learn more.

32
votes

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.

20
votes

in some cases you need to uninstall and install node-sass library. Try:

npm uninstall --save node-sass

and

npm install --save node-sass

look at this its work for me, Stack link here

18
votes

* 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.

17
votes

node-sass node module uses darwin binary file which is dependent on the version of node. This issue occurs when the binary file is not downloaded or wrong binary file is downloaded.

Node sass error

Reinstall node modules will download expected binary of node-sass:-

For Mac users:

rm -rf node_modules
npm cache clean --force
npm i
npm rebuild node-sass --force

For Windows users:

rmdir node_modules
npm cache clean --force
npm i
npm rebuild node-sass --force

but for some users, you need to check your node version's compatibility with node-sass version. Make it compatible using below table and run above commands again to fix this issue.

Node JS compatible node-sass version

If issue is still not fixed, check node-sass supported environment's list:- https://github.com/sass/node-sass/releases/

14
votes

Try to add suffix --force

npm rebuild node-sass --force
13
votes

For my particular case none of the above answers worked. So what it worked:

rm -rf node_modules 
rm -rf /tmp/* 
rm -rf /root/.npm/node-sass 
npm uninstall --save node-sass 
npm cache clean --force 

npm cache verify to check that nothing is left in the cache

npm install

Altough I haven't tried to reproduce the sequence it was a combination of the above that worked. In addition you may also try:

npm install --save node-sass or npm install node-sass -g

npm rebuild node-sass
npm install bindings
10
votes

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
8
votes

I had the same problem with Node v7.4.0 Current (Latest Features).

Did some reading here and downgraded Node to v6.9.4 LTS and after running npm rebuild node-sass it downloaded the binary and everything started working.

Downloading binary from https://github.com/sass/node-sass/releases/download/v3.13.1/win32-x64-48_binding.node
Download complete .] - :
Binary saved to D:\xxx\xxx-xxx\node_modules\node-sass\vendor\win32-x64-48\binding.node
Caching binary to C:\Users\user\AppData\Roaming\npm-cache\node-sass\3.13.1\win32-x64-48_binding.node`

7
votes

If your terminal/command prompt says:

Node Sass could not find a binding 
for your current environment: 
OS X 64-bit with Node 0.10.x

and you have tried the following commands such as:

npm cache clean --force 
rm -rf node modules 
npm install 
npm rebuild node-sass 
npm rebuild node-sass

& still NOTHING works..

Just run this in the terminal manually:

node node_modules/node-sass/scripts/install.js

now run

npm start or yarn start
5
votes

For Visual Studio 2015/2017, Right Click on your package.json and Click on Restore Packages.

This will make sure that the npm from the Visual Studio Tools External Tools is run and the binding will be rebuild based on that.

5
votes

I'm a Windows 8 user, recently updated Node to v8.11.1 and npm to v6.0.0 and faced similar issue. Nothing worked - npm install -g node-sass@latest or deleting the node-sass directory from the project node_modules/ - none of 'em worked for me.

The Laravel Mix was throwing an error to my browser console saying a missing node: win32-x64-57. I don't know whether it's because a slower internet connection or something, the node was missing during the update.

Hence some of the answers directed me to look at the Node-Sass releases, and I found the solution.

  1. Step 1: Check your node-sass version using the command: npm view node-sass version (the {your version} in step 4)
  2. Step 2: Get to Node-Sass Releases
  3. Step 3: Get your release and find the missing node in the assets listed under every release, and download the file
  4. Step 4: Get to your PC's C:\Users\{User}\AppData\Roaming\npm-cache\node-sass\{your version}\ and put the downloaded .node file inside the version folder

And you are done.

In my case the node-sass version was 4.9.0 and the missing node was win32-x64-57_binding.node, so I downloaded the .node file from 4.9.0 release and followed step 4.

4
votes

This happens when in your workstation you run an update of Node.js and you are using node-sass globally.

So you should uninstall node-sass globally

npm uninstall -g node-sass

And then you have to install it globally, again

npm install -g node-sass
4
votes

The post dependencies for node-sass is not getting installed without the package.json inside node-sass

Running it manually solved for me

node node_modules/node-sass/scripts/install.js 

credit: link

4
votes

This worked for me: yarn add --force [email protected] or yarn add --force node-sass

3
votes

This usually happens because the environment has changed since running npm install. Running npm rebuild node-sass builds the binding for the current environment.

3
votes

I had the same issue. I couldn't find any proper working solution in here, so I found mine:

Inspired by @Rob-Scott solution and other pointing that we could have 2 versions of Node.js installed, I went to C:\Program Files (x86)\nodejs and realized that I had a node.js version installed in addition to the VS default installation.

My solution was quite simple:

  • Go to Tools > Options > Projects & solutions > Web package management > External web tools
  • Click on add an entry (most left of the top-right block of buttons)
  • Enter C:\Program Files (x86)\nodejs, validate by pressing enter
  • Bring it at the top of the list
  • Enjoy

Probably Node.js is not set well in the PATH variable, but this is my working very quick solution, my 2 cents :)

3
votes

I had this issue when upgrading from VS 2017 Professional to Enterprise

  1. Close VS
  2. Delete node_modules
  3. Open VS
  4. Right click package.json and select 'restore packages'
3
votes
  1. Delete node_modules folder.
  2. Install dependencies again. (npm i)
3
votes

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
3
votes

Open Visual Studio 2017
Go to Tools -> Options…
Go to Projects and Solutions -> Web Package Management
Move $(PATH) to the top of that list and close that window.
Restart Visual Studio.
This worked in my case, because my node version is 11.x

3
votes

Just run the comment thats it.

npm rebuild node-sass

enjoy your coding...

3
votes

Run the following commands, it works fine for me.

npm install node-sass -g

npm rebuild node-sass

nvm use 10.16.3

node node_modules/node-sass/scripts/install.js

ng serve --poll=2000

2
votes

A similar error I encountered with Visual Studio 2015 Community Edition while having created an AspNetCore app was:

Node Sass could not find a binding for your current environment: Windows 32-bit with Node.js 5.x
Found bindings for the following environments:
  - Windows 64-bit with Node.js 6.x
This usually happens because your environment has changed since running `npm install`.
Run `npm rebuild node-sass` to build the binding for your current environment.
    at module.exports ([..]\node_modules\node-sass\lib\binding.js:15:13)
    at Object.<anonymous> ([..]\node_modules\node-sass\lib\index.js:14:35)
    at Module._compile (module.js:397:26)
    at Object.Module._extensions..js (module.js:404:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> ([..]\node_modules\gulp-sass\index.js:187:21)
    at Module._compile (module.js:397:26)

You can see the from the error above that the cause was from a version mismatch on the bindings for nodejs.

Node Sass could not find a binding for your current environment: Windows 32-bit with Node.js 5.x

Found bindings for the following environments: - Windows 64-bit with Node.js 6.x

The solution I found was to

  • Install the nodejs windows version,
  • Add path for node js (C:\Program Files\nodejs) in External Web Tools (see Rob Scott's answer),
  • Move nodejs path above $(PATH).
2
votes

This worked for me Deleting node_modules and then restoring packages from IDE and then npm rebuild node-sass