723

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?

10
  • 19
    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 again Commented Jun 23, 2016 at 9:06
  • 3
    Hey im not using nvm and I tried the removal/re-install step. no luck.
    – wazzaday
    Commented Jun 23, 2016 at 9:17
  • what is your development environment? you use VS.NET 2105? Commented Dec 9, 2016 at 13:38
  • @VasilDininski I'm using nvm, what should I do? Commented Apr 25, 2017 at 6:12
  • 8
    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.x Commented May 4, 2019 at 10:55

63 Answers 63

979

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 the problem

By going into the project folder and then executing the command:

npm rebuild node-sass
12
  • 9
    Worked initially but was still having problems. So, I went to /usr/local/lib/ using CMD+SHIFT+G in finder and renamed node-sass folder. Then ran npm install node-sass -g. that fixed. I'm on Mac OS
    – IsmailS
    Commented Jan 16, 2018 at 6:34
  • I was facing this issue after updating nodejs to 8.x.x and this solved it. Thanks much! Appreciated!
    – ChiragMS
    Commented Jul 18, 2018 at 4:06
  • 4
    Doesn't work. Node: v10.7.0 node-sass: v3.13.1. Says my current environment is 32 bit windows with node 0.10.x which is simply not true.
    – Bardicer
    Commented Aug 1, 2018 at 21:43
  • 22
    First step would be to delete your node_modules and run npm install rather than rebuilding your node-sass. Commented Feb 28, 2019 at 11:47
  • 6
    Problem persisted after npm rebuild node-sass. However, npm uninstall node-sass then npm install node-sass worked for me.
    – Bilbo
    Commented Sep 30, 2020 at 22:11
366

For those that are using Visual Studio:

Currently working for VS 2015, 2017, 2019, 2022 (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), VS 2019, and VS 2022

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

In VS 2017, 2019, 2022, 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.

15
  • 5
    If you are using VS2015 you should definitely make the changes described in this answer. It's probably all you will need to do to fix this issue.
    – Bonneville
    Commented Jan 17, 2017 at 2:30
  • 12
    This also worked for a brand new install of VS2017 also.
    – sarin
    Commented Mar 10, 2017 at 14:19
  • 8
    In VS2017.3, the path to the setting is Tools > Options > Projects and Solutions > Web Package Management > External Web Tools
    – nothrow
    Commented Sep 6, 2017 at 20:17
  • 11
    damn!i would never figure it out... all to compile stupid sass with stupid node in stupid javascript Commented Aug 12, 2018 at 7:41
  • 20
    Can confirm, this is still a thing in VS 2019.
    – JamesT
    Commented Jul 24, 2019 at 8:26
193

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



If the above for some reason didn't work out for you, try this:
  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
2
  • 2
    The above worked for me, albeit that it occurred twice in two different apps in two different folders. The python install was a one-off (i.e.not needed when I got the error a second time on my other app) and I didn't need the final npm run build command (not explicitly at least) but I did need to run the rebuild --force twice for both my apps. Commented Jul 20, 2018 at 19:32
  • 1
    Rebuild need more then 10 minutes on my Ubuntu 20.04. Commented Jul 16, 2021 at 13:31
170

Worked for me:

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

6
  • 5
    This works for me too. Clearly a node version conflict. Thanks!
    – Liz Lemon
    Commented Feb 23, 2018 at 7:25
  • 1
    Did have to delete it the following directory: C:\Users\your_user_name\AppData\Roaming\npm-cache
    – Matt
    Commented Sep 6, 2018 at 20:07
  • 8
    This worked! npm rebuild node-sass did not work for me. (Mac with WebStorm)
    – Jackpile
    Commented Oct 11, 2018 at 23:17
  • 3
    This is the only solution that worked for me! npm rebuild node-sass --force didn't work either.
    – bigsee
    Commented Apr 24, 2019 at 16:16
  • This should be marked as the answer. Until now I had no idea why my solution kept targeting a higher version of node and kept giving me error message about nodesass. I had a step in the Azure pipeline to force the node version to the one I want. Now I can removed that step! Commented Feb 19, 2020 at 11:22
154

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

12
  • 3
    Also worked for me, thanks! Tried cleaning up node_modules, deleting cache, rifraf, rebuild node-sass, rebuild from VS2015 instead of from command line with npm and at the end this fixed it. Commented Jan 11, 2017 at 19:02
  • 1
    @JanCiołek I only had this happen once, so I never had to redo this. I'm not sure if it was version specific, or if there was just a problem with the specific install, but I found no better solution (the other answers here did not work for me). Cumbersome or not, it seemed to be the necessary solution for some variations of this problem.
    – Beofett
    Commented Feb 20, 2018 at 13:07
  • 1
    @Beofett This bug ate alot of my time,i did all that was mentioned in this thread but i forget to run compilation.Thanks ! Commented Feb 20, 2018 at 13:11
  • 6
    This is the only answer that worker for me, but found my binding in github.com/sass/node-sass/releases instead of the linked URL. Cheers
    – clapas
    Commented Mar 15, 2018 at 10:18
  • 2
    Thank you @Beofett. Your answer saved me to run my Ionic project in Windows and Mac OSX. Commented Apr 9, 2018 at 14:35
40

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.

1
  • thank god for this. I actually tried to downgrade node on my macbook first and then gave up after half an hour Commented Feb 15, 2019 at 16:28
40

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.

4
  • 1
    Facing the same issue with different environments: - dev under MacOS for unit tests - dev using docker-compose (for full system interactions) - prod under alpine-based OS ; Mounting (or not) and npm install (or not) in docker is problematic when having architecture dependent modules: getting darwin or linux binaries depending on where you npm i It happens for NodeJS modules like node-sass, or @google-cloud/pubsub
    – Laurent
    Commented Dec 2, 2018 at 19:37
  • Thank you for mentioning the solution for docker, this is exactly what fixed it for me! Commented Apr 24, 2019 at 12:27
  • I had /node_modules which was being bind mounted into the container at /app/node_modules. Even though my NODE_PATH was /node_modules (which did exist) and should have been in a different spot.., it randomly started causing issues. I had installed at both places so that my dev deps for prettier would work with my vscode. whoops. weird stuff. Thank you for the docker mention <3
    – Nick Brady
    Commented Apr 19, 2020 at 23:18
  • I found this worked after deleting /node_modules/, then running 'npm install' then your command 'npm rebuild node-sass --force' Commented Sep 8, 2020 at 10:58
25

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][1]][1]

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.

This is node compatibility table with node-sass

NodeJS | Supported node-sass version | Node Module
Node 19     8.0+                        111
Node 18     8.0+                        108
Node 17     7.0+                        102
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 issue is still not fixed, check node-sass supported environment's list:- https://github.com/sass/node-sass/releases/

1
  • Also, if you clone others project you need to change the node in your package.json to your current node version.
    – Sari Masri
    Commented Jun 18, 2020 at 10:24
21

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

0
20

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

1
  • 1
    Can someone elaborate this answer? This is something I needed, but it would be helpful if anyone can explain this answer. Thanks
    – Waseem
    Commented Dec 7, 2022 at 15:04
19

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

& 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

3
  • 1
    Finally! Thank you. This is the only solution worked for me so far. I've been struggling for two days. Could you please explain what is the reason behind?
    – burakcalik
    Commented May 15, 2020 at 15:55
  • 1
    YES YES YES! Finally! Jackie - Thank you soooooo much. Commented Jun 1, 2020 at 21:36
  • 1
    should be rm -rf node_modules
    – QkiZ
    Commented Aug 26, 2022 at 15:35
15

Try to add suffix --force

npm rebuild node-sass --force
1
  • 1
    Worked for me. Thank you.
    – codajoao
    Commented Feb 2, 2018 at 16:46
15

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
0
15

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
9

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`

6

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.

1
  • 2
    Woaw... we got stuck on this for a full hour on a colleague's computer before finding this anwser. Nothing else worked, even trashing the whole node_modules directory. This completely solved the issue for us, thanks a lot for your help.
    – ZeRemz
    Commented Jul 16, 2020 at 13:18
5

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.

1
  • Nice and easy solution, and the only one that worked from the few above that I tried. Thanks! Commented May 30, 2018 at 16:07
5

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

2
  • Thanks for this, this solved my issue perfectly! :) Commented Jan 15, 2020 at 10:15
  • Glad to know :)
    – Mukundhan
    Commented Jan 15, 2020 at 12:38
4

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 :)

4

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
2
  • Good explanation! Commented Jan 24, 2019 at 12:29
  • @Fay007 could you provide more info? Do you have an error? Let me know
    – Nico
    Commented Mar 19, 2019 at 21:50
4

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

4

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

3

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
  1. Create a new directory in node_modules/node-sass/vendor/linux-x64-46/ .
  2. the download fil from https://github.com/sass/node-sass/releases
    (linux-x64-59_binding.node) based upon your version.
  3. paste it in node_modules/node-sass/vendor/linux-x64-46/ rename it to binding.node
1
  • although not a good practice, this solution might actually work (when all others fail) so when downvoting, it should be clarified why
    – Alex P.
    Commented Nov 23, 2018 at 12:00
3

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'
1
  • This is the safest approach for Visual Studio. Forget about all of these commands because they probably won't work. The commands have to be run from the same environment, which is the tricky part. Let visual studio do it and you're set.
    – AlexPi
    Commented Jul 6, 2020 at 19:51
3
  1. Delete node_modules folder.
  2. Install dependencies again. (npm i)
2
  • This is only solution with npm or yarn. Commented Dec 29, 2019 at 14:23
  • Thank you! This was driving me nuts, and your solution fixed it for me!
    – Shaul Behr
    Commented Mar 15, 2021 at 13:09
3

None of the install/rebuild solutions resolved the issue for me (using gulp).

Here is how I resolved it:

1) Download the missing binding file from the repository.

2) Rename the file binding.node.

3) Create node_modules/node-sass/vendor/darwin-x64-11 (path from error message) directory if it doesn't exist.

4) Add the binding file to node_modules/node-sass/vendor/darwin-x64-11

3

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

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

1
  • 1
    Definitely a valid answer when different projects use different bindings. Executing rebuild node-sass was not enough. Changing the path priority fixed this. Commented Oct 25, 2019 at 13:58
3

Probably you have a build with different node version than the current one. Try running these commands and it should fix the issue.

npm cache clean --force &&  
rm -rf node_modules &&  
rm -rf package-lock.json &&  
npm i
2
  • 1
    This worked, but I believe line 3 should be package-lock.json. Concise and correct - many thanks.
    – cssyphus
    Commented Dec 8, 2021 at 15:27
  • That was a typo, updated command, thank you! Commented Mar 23, 2022 at 8:55

Not the answer you're looking for? Browse other questions tagged or ask your own question.