node-sass icon indicating copy to clipboard operation
node-sass copied to clipboard

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

Open mgkamal opened this issue 11 years ago • 53 comments

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 avatar Sep 20 '15 20:09 mgkamal

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 avatar Sep 20 '15 20:09 saper

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 avatar Sep 20 '15 20:09 mgkamal

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 avatar Sep 20 '15 20:09 saper

@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 avatar Sep 21 '15 01:09 xzyfer

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 avatar Sep 21 '15 01:09 xzyfer

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 avatar Sep 26 '15 00:09 joemccann

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 avatar Sep 26 '15 09:09 conraid

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 avatar Sep 26 '15 10:09 saper

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

joemccann avatar Sep 26 '15 15:09 joemccann

I had to do:

npm rebuild node-sass
rm -rf node_modules
npm i

justin808 avatar Oct 13 '15 19:10 justin808

@justin808 Worked for me :+1:

A5hleyRich avatar Nov 14 '15 10:11 A5hleyRich

@justin808 Worked for me as well, finally!

ivorbosloper avatar Nov 18 '15 22:11 ivorbosloper

Worked for me as well, thanx

kevalbhatt avatar Dec 10 '15 06:12 kevalbhatt

@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 avatar Dec 23 '15 16:12 hamedmehraei

Windows.

justin808 avatar Dec 23 '15 18:12 justin808

@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 avatar Dec 24 '15 02:12 kevalbhatt

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/

maxwowpow avatar Jan 04 '16 15:01 maxwowpow

Thanks @maxgrass - that did the trick!

npapazian avatar Jan 12 '16 19:01 npapazian

Works perfectly for me to ! Thanks ;-)

Airboy avatar Jan 14 '16 11:01 Airboy

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

hamedmehraei avatar Jan 14 '16 12:01 hamedmehraei