Node-sass: node 4.0.0 - Error: The libsass binding was not found in /node_modules/gulp-sass/node_modules/node-sass/vendor/darwin-x64-14/binding.node

-1

NodeJS version 4.0.0
npm 2.14.2
XCode (Version 7.0 (7A220))
MAC OS: Yosemite 10.10.5 (14F27)

When I tried running "gulp-sass", getting error in "node-sass" package.

Error details:
/node_modules/gulp-sass/node_modules/node-sass/lib/extensions.js:150
throw new Error([
^
Error: The libsass binding was not found in /node_modules/gulp-sass/node_modules/node-sass/vendor/darwin-x64-14/binding.node

Tried below 2 options but still getting the same error,

  1. Removed "gulp-sass" from package.json
    Delete node_modules
    Install "gulp-sass" as dev dependency (npm install gulp-sass --save-dev)
    npm install
    gul-sass
  2. npm rebuild node-sass
  3. npm remove node-sass
    npm install node-sass
mgkamal picture mgkamal  ·  20 Sep 2015

Most helpful comment

94

I had to do:

npm rebuild node-sass
rm -rf node_modules
npm i
justin808 picture justin808  ·  13 Oct 2015

All comments

2

gul-sass won't work. Please copy the command exactly.

Can you post the full output of npm install --verbose node-sass to gist.github.com? Thanks.

saper picture saper  ·  20 Sep 2015
1

It's a typo. Actually, I have a gulp task which requires the "gulp-sass" package. When I run the gulp task, was facing these issues.

Error was reported saying "vendor/darwin-x64-14/binding.node" not found. But, when I explored the folder structure inside node_modules, I see "vendor/darwin-x64-46/binding.node". Not sure how darwin version of "46" got created but still node-sass was looking for "14".

So, manually created folder "darwin-x64-14". Then downloaded equivalent "binding.node" file from
https://github.com/sass/node-sass-binaries/blob/master/darwin-x64-14_binding.node
and copied the file to "darwin-x64-14" folder.

After this, everything is working fine; but only through manual process.

Inside "node_sass/package.json", I see
"name": "node-sass",
"version": "3.3.3",
"libsass": "3.2.5",

Please let me know, if I am missing anything. Not sure why "darwin-x64-46" folder is getting created while "node-sass" package is looking for "darwin-x64-14" folder.

mgkamal picture mgkamal  ·  20 Sep 2015
1

https://github.com/sass/node-sass-binaries/blob/master/darwin-x64-14_binding.node

^^ This one is for node 0.12

https://github.com/sass/node-sass-binaries/blob/master/darwin-x64-46_binding.node

^^ This one is for node 4.0.0

Probably your gulp stuff is still using node 0.12.

saper picture saper  ·  20 Sep 2015
9

@mgkamal regarding

The libsass binding was not found in x

For context this error is almost always because npm install ran with a
different version of node than the version you're current running.

Since node-sass is a native module we build the c++ code on installation.
That code is tied to the version of node that ran the installation. If you
change your node version the extension needs to be rebuilt, that's what
npm rebuild does.
https://github.com/sass/node-sass/issues/906#issuecomment-140331138

xzyfer picture xzyfer  ·  21 Sep 2015
22

This means at some point you ran npm install with node 0.12. You later updated to node 4 make the 0.12 install incompatible. As of 3.4.0 we produce a more useful error message which instructs you to run npm rebuild node-sass which resolves this issue.

xzyfer picture xzyfer  ·  21 Sep 2015
5

Had same issue on Ubuntu 14.04

Went here

https://github.com/sass/node-sass-binaries/blob/master/darwin-x64-14_binding.node

and scp the file into node_modules/node-sass/vendor/linux-x64-46/

I had to create the linux-x64-46 directory

joemccann picture joemccann  ·  26 Sep 2015
4

Same issue here, Slackware 64 current

I solved with:

install -Dm644 linux-x64-46_binding.node /usr/lib64/node_modules/node-sass/vendor/linux-x64-46/binding.node

where linux-x64-46_binding.node is https://github.com/sass/node-sass-binaries/raw/master/linux-x64-46_binding.node

conraid picture conraid  ·  26 Sep 2015
0

Looks like we have a pattern here. Who would be available for a live troubleshooting session over IRC or Slack? You can find me as "saper" on irc.freenode.net, just join #io.js and ping me there.

saper picture saper  ·  26 Sep 2015
0

@sasper the resolution is getting the latest binding.node for said platform. After that, it's pretty straightforward.

joemccann picture joemccann  ·  26 Sep 2015
94

I had to do:

npm rebuild node-sass
rm -rf node_modules
npm i
justin808 picture justin808  ·  13 Oct 2015
1

@justin808 Worked for me :+1:

A5hleyRich picture A5hleyRich  ·  14 Nov 2015
1

@justin808 Worked for me as well, finally!

ivorbosloper picture ivorbosloper  ·  18 Nov 2015
1

Worked for me as well, thanx

kevalbhatt picture kevalbhatt  ·  10 Dec 2015
-24

@justin808 when i write: rm -rf node_modules this message shown:
'rm' is not recognized as an internal or external command,
operable program or batch file.

My OS is Windows 10 Enterprise 64-bit

hamedmehraei picture hamedmehraei  ·  23 Dec 2015
19

Windows.

justin808 picture justin808  ·  23 Dec 2015
3

@hamedmehraei rm -rf is uinx command see this link http://www.lemoda.net/windows/windows2unix/windows2unix.html and if you want unix command in window then install cygwin then you can use rm -rf command

UNIX | WINDOWS
rm | del
rm -r | deltree

kevalbhatt picture kevalbhatt  ·  24 Dec 2015
27

Quick note for Visual Studio people who bump into this issue from google:
If everything works from CMD but fails from VS (asp.net 5) it's because VS uses internal nodejs, so gulp and co will be run by it. We have to override the path to the latest/correct nodejs:
http://ryanhayes.net/synchronize-node-js-install-version-with-visual-studio-2015/

maxgrass picture maxgrass  ·  4 Jan 2016
1

Thanks @maxgrass - that did the trick!

npapazian picture npapazian  ·  12 Jan 2016
1

Works perfectly for me to ! Thanks ;-)

Airboy picture Airboy  ·  14 Jan 2016
1

Thank @kevalbhatt. it worked :) :+1:

hamedmehraei picture hamedmehraei  ·  14 Jan 2016
1

Thanks @maxgrass - Totally worked.

smedavarapu picture smedavarapu  ·  18 Jan 2016
1

@justin808 method worked for me in one go! Thanks mate :)

fahimshekaib picture fahimshekaib  ·  19 Jan 2016
1

Thanks @justin808 worked very well for me!

ViniciusSossela picture ViniciusSossela  ·  10 Feb 2016
1

@justin808 Thanks a lot. It worked like a charm.

shagun11 picture shagun11  ·  12 Feb 2016
0

I had to rename

node_modules/node-sass/vendor/linux-x64-
to
node_modules/node-sass/vendor/linux-x64-64

node: 4.3.0
node-sass: ^3.4.2

zoechi picture zoechi  ·  15 Feb 2016
1

@justin808 Thanks

janjon picture janjon  ·  16 Feb 2016
1

@justin808 :+1:

rflmyk picture rflmyk  ·  19 Feb 2016
0

In Linux (Slackware current) I had to delete the contents of $HOME/.npm (/root/.npm).
In this way build binding file

conraid picture conraid  ·  19 Feb 2016
1

@justin808 thanks!

hungtrinh7 picture hungtrinh7  ·  19 Feb 2016
0

I had to rename
node_modules\node-sass\vendor\win32-ia32-46
to
node_modules\node-sass\vendor\win32-ia32-11
on Win 10.

Unfortunately, now I just get
module.js:356 Module._extensions[extension](this, filename); ^ Error: A dynamic link library (DLL) initialization routine failed. ...node_modules\node-sass\vendor\win32-ia32-11\binding.node

neilsimp1 picture neilsimp1  ·  21 Feb 2016
0

@neilsimp1 you need to fetch a proper module, just renaming the directory will not work. You can fetch binaries manually from https://github.com/sass/node-sass-binaries

saper picture saper  ·  21 Feb 2016
1

@saper Thank you so much, that did the trick!

neilsimp1 picture neilsimp1  ·  21 Feb 2016
1

@justin808 :+1: super thanks !

tomhermans picture tomhermans  ·  23 Feb 2016
0

This is unrelated and just renaming the directory will not work. Make sure you npm install with the same node engine as you run. It is possible to have multiple bindings in the vendor directory.

saper picture saper  ·  24 Feb 2016
1

@justin808 thx!!!!!

zamiatin picture zamiatin  ·  26 Feb 2016
0

@neilsimp1 please check @maxgrass comment above. You are using a different node engine to install and a different one to run your sass. If you need to switch engines for some reason, you can download additional modules from https://github.com/sass/node-sass-binaries (you need to download the binary file, create the directory and rename the file to binding.node)

saper picture saper  ·  1 Mar 2016
0

If anybody faces the problem using MS Visual Studio 2015 and running gulp from its Task Runner, please try to restore npm packages first by right clicking packages.json from solution explorer and choosing "restore packages".

codialsoftware picture codialsoftware  ·  11 Mar 2016
0

Works for me too

hermannpessoa picture hermannpessoa  ·  4 May 2016
1

you should use

npm rebuild node-sass

don't use rm -rf node_modules . if you do this , the error will show again when you run task

pandaTerminator picture pandaTerminator  ·  15 May 2016
0

@neilsimp1 make sure you are using only the same node engine version when installing and when running your application.

saper picture saper  ·  16 May 2016
0

@saper
Can someone help me with this issue:

ERROR in Missing binding /tmp/build/node_modules/node-sass/vendor/linux-x64-46/binding.node
Node Sass could not find a binding for your current environment: Linux 64-bit with Node.js 4.x

Found bindings for the following environments:

  • Unknown environment (Linux 64-bit)
  • OS X 64-bit with Node.js 4.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.

sj2208 picture sj2208  ·  17 May 2016
0

npm rebuild node-sass

xzyfer picture xzyfer  ·  17 May 2016
0

Here is the output for
npm rebuild node-saas

/app npm rebuild node-sass

[email protected] install /app/node_modules/node-sass
node scripts/install.js

Binary downloaded and installed at /app/node_modules/node-sass/vendor/darwin-x64-46/binding.node

[email protected] postinstall /app/node_modules/node-sass
node scripts/build.js

"/app/node_modules/node-sass/vendor/darwin-x64-46/binding.node" exists.
testing binary.
Binary is fine; exiting.
[email protected] /app/node_modules/node-sass

But still when i do npm pack it gives the error

ERROR in Missing binding /tmp/build/node_modules/node-sass/vendor/linux-x64-46/binding.node
Node Sass could not find a binding for your current environment: Linux 64-bit with Node.js 4.x

Found bindings for the following environments:

  • OS X 64-bit with Node.js 4.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.

sj2208 picture sj2208  ·  17 May 2016
0

The message is very clear. You built the binding on OSX and then you've
changed your environment to Linux. The binding you built is for OSX you
need to rebuild it for Linux.
On 18 May 2016 1:35 AM, "Sourabh" [email protected] wrote:

Here is the output for
npm rebuild node-saas

/app npm rebuild node-sass

[email protected] install /app/node_modules/node-sass
node scripts/install.js

Binary downloaded and installed at
/app/node_modules/node-sass/vendor/darwin-x64-46/binding.node

[email protected] postinstall /app/node_modules/node-sass
node scripts/build.js

"/app/node_modules/node-sass/vendor/darwin-x64-46/binding.node" exists.
testing binary.
Binary is fine; exiting.
[email protected] /app/node_modules/node-sass

But still when i do npm pack it gives the error

ERROR in Missing binding
/tmp/build/node_modules/node-sass/vendor/linux-x64-46/binding.node
Node Sass could not find a binding for your current environment: Linux
64-bit with Node.js 4.x

Found bindings for the following environments:

  • OS X 64-bit with Node.js 4.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.


You are receiving this because you modified the open/close state.
Reply to this email directly or view it on GitHub
https://github.com/sass/node-sass/issues/1162#issuecomment-219757151

xzyfer picture xzyfer  ·  17 May 2016
1

I have similar issue, here is the env details:

Node: v4.4.7
Npm: 2.15.8
OS: Ubuntu 14.04 X64

I have grunt-sass in my package.json, after npm install finished, I can't find vendor folder in node_modules/grunt-sass/node_modules/node-sass/ folder, to fix this issue I need use $ npm rebuild node-sass to manually rebuild the binary file, I don't understand why it doesn't generate the binary file during normal npm install?

HouCoder picture HouCoder  ·  13 Jul 2016
0

BTW, I have no problem in OS X, which runs the same version of Node and Npm.

HouCoder picture HouCoder  ·  13 Jul 2016
0

Found the solution. Node 6.3.1 seems to resolve all above issue. Consider upgrading it. Works for brew too.

brew update
brew upgrade node

padlock98 picture padlock98  ·  25 Jul 2016
5

Had the same issue on [email protected] Node.[email protected] [email protected]
npm install node-sass -g solved it for me, hope it helps anyone.

ibasoni picture ibasoni  ·  1 Aug 2016
1

For reference, I just had this issue, my dev environment is as follows:

Windows 10
Node: 6.9.1
NPM: 3.10.7
node-sass: 3.4.2

I was repeatedly getting build/ELIFECYCLE errors when running npm rebuild node-sass

To fix the issue, I had to manually download win32-x64-48-binding.node from here: https://github.com/sass/node-sass-binaries, put it in the _node_modules/node-sass/vendor/win32-x64-48_ directory (this directory already existed but was empty) and rename the file to binding.node

I also downloaded the win32-x64-48_binding.pdb file, but I did not rename it after placing it in the above directory, and I'm not sure it's required (required only to build the binding I guess, which I no longer need to do)

The problem is now fixed, I still can't run npm rebuild node-sass, but I can use node-sass again

danwellman picture danwellman  ·  25 Oct 2016
0

@ibasoni that's the piece i was missing. thanks!

shoesandsocks picture shoesandsocks  ·  2 Nov 2016
0

@justin808 👍 it's work it
awesome!!

brain00021 picture brain00021  ·  17 Jan 2017
0

@justin808 you are awesome! Thanks mate!

xantico-aleks picture xantico-aleks  ·  18 Jan 2017
0

After had try so much, this solution work for me:

npm uninstall node-sass
npm install node-sass
npm rebuild node-sass

PS: I had forget the TIP to resolve all problems:

The obviously first.

odravison picture odravison  ·  8 May 2017