Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 #1162

Closed
mgkamal opened this issue Sep 20, 2015 · 53 comments

Comments

@mgkamal
Copy link

mgkamal commented Sep 20, 2015

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
@saper
Copy link
Member

saper commented Sep 20, 2015

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.

@mgkamal
Copy link
Author

mgkamal commented Sep 20, 2015

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.

@saper
Copy link
Member

saper commented Sep 20, 2015

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.

@xzyfer
Copy link
Contributor

xzyfer commented Sep 21, 2015

@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.
#906 (comment)

@xzyfer
Copy link
Contributor

xzyfer commented Sep 21, 2015

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.

@joemccann
Copy link

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

@conraid
Copy link

conraid commented Sep 26, 2015

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

@saper
Copy link
Member

saper commented Sep 26, 2015

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.

@joemccann
Copy link

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

@justin808
Copy link

I had to do:

npm rebuild node-sass
rm -rf node_modules
npm i

@A5hleyRich
Copy link

@justin808 Worked for me 👍

@ivorbosloper
Copy link

@justin808 Worked for me as well, finally!

@kevalbhatt
Copy link

Worked for me as well, thanx

@hamedmehraei
Copy link

@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

@justin808
Copy link

Windows.

@kevalbhatt
Copy link

@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

@maxwowpow
Copy link

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/

@npapazian
Copy link

Thanks @maxgrass - that did the trick!

@Airboy
Copy link

Airboy commented Jan 14, 2016

Works perfectly for me to ! Thanks ;-)

@hamedmehraei
Copy link

Thank @kevalbhatt. it worked :) 👍

@smedavarapu
Copy link

Thanks @maxgrass - Totally worked.

@fahimshekaib
Copy link

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

@ViniciusSossela
Copy link

Thanks @justin808 worked very well for me!

@shagun11
Copy link

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

@zoechi
Copy link

zoechi commented Feb 15, 2016

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

@neilsimp1
Copy link

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

@saper
Copy link
Member

saper commented Feb 21, 2016

@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

@neilsimp1
Copy link

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

@tomhermans
Copy link

@justin808 :+1: super thanks !

@saper
Copy link
Member

saper commented Feb 24, 2016

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.

@zamiatin
Copy link

@justin808 thx!!!!!

@saper
Copy link
Member

saper commented Mar 1, 2016

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

@codialsoftware
Copy link

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

@hermannpessoa
Copy link

Works for me too

@pandaTerminator
Copy link

pandaTerminator commented May 15, 2016

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

@saper
Copy link
Member

saper commented May 16, 2016

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

@sj2208
Copy link

sj2208 commented May 17, 2016

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

@xzyfer
Copy link
Contributor

xzyfer commented May 17, 2016

npm rebuild node-sass

@sj2208
Copy link

sj2208 commented May 17, 2016

Here is the output for
npm rebuild node-saas

/app npm rebuild node-sass

node-sass@3.7.0 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

node-sass@3.7.0 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.
node-sass@3.7.0 /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.

@xzyfer
Copy link
Contributor

xzyfer commented May 17, 2016

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" notifications@github.com wrote:

Here is the output for
npm rebuild node-saas

/app npm rebuild node-sass

node-sass@3.7.0 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

node-sass@3.7.0 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.
node-sass@3.7.0 /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
#1162 (comment)

@HouCoder
Copy link

HouCoder commented Jul 13, 2016

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
Copy link

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

@padlock98
Copy link

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

@pixelpusher83
Copy link

Had the same issue on OSX@10.11.5 Node.js@6.2.1 npm@3.10.3.
npm install node-sass -g solved it for me, hope it helps anyone.

@danwellman
Copy link

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

@shoesandsocks
Copy link

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

@brain00021
Copy link

@justin808 👍 it's work it
awesome!!

@mplt-aleks
Copy link

@justin808 you are awesome! Thanks mate!

@odravison
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests