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
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,
- 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
- npm rebuild node-sass
- npm remove node-sass npm install node-sass
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.
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.
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.
@mgkamal regarding
The libsass binding was not found in x
For context this error is almost always because
npm installran 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 rebuilddoes. https://github.com/sass/node-sass/issues/906#issuecomment-140331138
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.
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
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
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.
@sasper the resolution is getting the latest binding.node for said platform. After that, it's pretty straightforward.
I had to do:
npm rebuild node-sass
rm -rf node_modules
npm i
@justin808 Worked for me :+1:
@justin808 Worked for me as well, finally!
Worked for me as well, thanx
@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
Windows.
@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
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/
Thanks @maxgrass - that did the trick!
Works perfectly for me to ! Thanks ;-)
Thank @kevalbhatt. it worked :) :+1: