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

Error: Missing binding

Open danielbayley opened this issue 10 years ago • 15 comments

OS X 10.11.4 Atom 1.7.3 Node v6.0.0 source-preview v0.5.0

I'm getting the following error with my Atom package source-preview-sass:

Error: Missing binding /Users/Dan/Library/Application Support/Atom/dev/packages/source-preview-sass/node_modules/node-sass/vendor/darwin-x64-47/binding.node Node Sass could not find a binding for your current environment: OS X 64-bit with Node.js 5.x Found bindings for the following environments:

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

I was hoping that updating my node-sass dependency to ^3.7.0 would fix this but it didn't 😞

Possibly related to #1504 and #1515?

danielbayley avatar May 05 '16 02:05 danielbayley

The Atom shell isn't supported, see #1047

nschonni avatar May 05 '16 02:05 nschonni

Correct atom shell is not supported. However this warning is about a missing binary. I don't know how this error could be any more clear.

Problem

Node Sass could not find a binding for your current environment: OS X 64-bit with Node.js 5.x

Hint

Found bindings for the following environments:

  • OS X 64-bit with Node.js 6.x

Explanation

You previously install node-sass using Node.js. You're now on Node.js 5.

This usually happens because your environment has changed since running npm install.

Steps to solve problem

Run npm rebuild node-sass to build the binding for your current environment.

xzyfer avatar May 05 '16 03:05 xzyfer

Correct atom shell is not supported. However this warning is about a missing binary.

@xzyfer @nschonni By not supported do you mean doesn't compile the correct binding into node-sass/vendor in a cross-platform way?

If I manually download the correct binding, which happens to be darwin-x64-47 in my case and put it into $ATOM_HOME/packages/source-preview-sass/node_modules/node-sass/vendor/darwin-x64-47/binding.node then my package works fine, but obviously this isn't automated/doesn't scale.

So from digging around in #1047 and other issues I tried multiple suggested approaches to work around this…

  • npm rebuild node-sass as suggested didn't work from my package root directory, but then…
  • apm rebuild node-sass did, but put darwin-x64-11 into the vendors folder as opposed to darwin-x64-47 (the one which works) so I'm a bit confused;

I'm guessing this is because my system Node (/usr/local/bin/node) is v6.0.0, whereas Atom's (apm) is v0.10.40 /Applications/Atom.app/Contents/Resources/app/apm/bin/node ./node_modules/node-sass/scripts/install.js -f did exactly the same thing as apm rebuild.

All my past use of libsass has been via brew install sassc, so forgive my ignorance of this Node bindings problem.

Would electron-rebuild be a solution to this?

danielbayley avatar May 05 '16 16:05 danielbayley

I want to preface what I'm about to say with noting that noone on the Node Sass team is particularly experienced with the atom shell.

By not supported [what] do you mean

Atom uses it's own (possibly forked) version of Node. Even if you have the correct binding for the reported Node version I believe with error. I can't confirm this but I have anecdotal evidence from previous issue threads.


It seems you may be misunderstanding how the atom shells works. Node 5 (47) is your local version, however atom has it's own embedded Node 0.10 (11). This is why apm rebuild node-sass is install the binary for Node 0.10.

Atom plugins work in background, inside a special atom Node environment so it will install in a way that works for that environment. I can't imagine a circumstance under which you would need to interact with node-sass directly.

It sounds like you're doing something not quite right with regards to the plugin. I open a discussion with the plugin authors to discuss what it is you're trying to do.

xzyfer avatar May 10 '16 10:05 xzyfer

I have the same issue in my ember.js project. I end up install different node version then this error gone.

The npm rebuild node-sass does not really help here.

For example: For ember 1.11, I need to install iojs1.6.4 node version For ember 2.4, I need to install node-6.3.0 version

szlike avatar Jul 15 '16 19:07 szlike

@szlike that's fine. Everytime you change your node version just run npm rebuild node-sass and fetch the correct binary for your current version.

xzyfer avatar Jul 19 '16 04:07 xzyfer

I open a discussion with the plugin authors

I am the plugin author… 😄

danielbayley avatar Jul 24 '16 15:07 danielbayley

Found the solution. For my case, I was using both Meteor (requires Node 0.10.x) while React-Native (requires Node.js 6.x which is installed). And I was using brew to install Node.

So followed the advise to use nvm to install older version of Node: http://michael-kuehnel.de/node.js/2015/09/08/using-vm-to-switch-node-versions.html

npm install followed by meteor my Meteor app and problem solved!

Switch node back to version 6 using nvm. Found out that Meteor app is able to run normally now.

Nutshell, install the lower version and switch it back to latest version.

npm rebuild node-sass doesn't really help in this case.

padlock98 avatar Jul 25 '16 21:07 padlock98

I had the same problem and npm rebuild node-sass didn't entirely fix it.

I had to terminals open to the same directory. I did ran nvm use v4.5.0, nvm install and npm rebuild node-sass in one terminal. I forgot to run nvm use v4.5.0 in the other window so it was running a different version of node with packages for the wrong version.

Stupid mistake and I wasted 30 mins trying to fix it. Hope this helps someone.

Solution

Reload your terminal or run nvm use v{some version} to use the correct version.

ifnull avatar Aug 31 '16 00:08 ifnull

npm rebuild node-sass doesn't work for me.

$ /var/www/nphs.social$ npm rebuild node-sass

> [email protected] install /var/www/nphs.social/node_modules/gulp-sass/node_modules/node-sass
> node scripts/install.js


> [email protected] postinstall /var/www/nphs.social/node_modules/gulp-sass/node_modules/node-sass
> node scripts/build.js

"/var/www/nphs.social/node_modules/gulp-sass/node_modules/node-sass/vendor/linux-x64-11/binding.node" exists. 
 testing binary.
Binary is fine; exiting.
[email protected] /var/www/nphs.social/node_modules/gulp-sass/node_modules/node-sass

All appears to go well. However:

$ gulp sass
/var/www/nphs.social/node_modules/gulp-sass/node_modules/node-sass/lib/index.js:15
    throw new Error(errors.missingBinary());
    ^

Error: Missing binding /var/www/nphs.social/node_modules/gulp-sass/node_modules/node-sass/vendor/linux-x64-48/binding.node
Node Sass could not find a binding for your current environment: Linux 64-bit with Node.js 6.x

Found bindings for the following environments:
  - Linux 64-bit with Node 0.10.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.
    at Object.<anonymous> (/var/www/nphs.social/node_modules/gulp-sass/node_modules/node-sass/lib/index.js:15:11)
    at Module._compile (module.js:556:32)
    at Object.Module._extensions..js (module.js:565:10)
    at Module.load (module.js:473:32)
    at tryModuleLoad (module.js:432:12)
    at Function.Module._load (module.js:424:3)
    at Module.require (module.js:483:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/var/www/nphs.social/node_modules/gulp-sass/index.js:187:21)
    at Module._compile (module.js:556:32)

Uninstalling and re-installing node-sass doesn't correct the problem either.

Any thoughts about what could be wrong?

Thanks, Luke.

controversial avatar Sep 11 '16 20:09 controversial

@controversial your "gulp" command and your "npm" command seem to refer to different node engines you have installed. "npm" uses 0.10 (is this a debian-like system with node 0.10 installed as "nodejs" - you didn't say?) while gulp uses something newer. Maybe you have both "nodejs" and "node".

saper avatar Sep 11 '16 22:09 saper

I'll check when I get a chance and report back.

On Sun, Sep 11, 2016 at 6:33 PM Marcin Cieślak [email protected] wrote:

@controversial https://github.com/controversial your "gulp" command and your "npm" command seem to refer to different node engines you have installed. "npm" uses 0.10 (is this a debian-like system with node 0.10 installed as "nodejs" - you didn't say?) while gulp uses something newer. Maybe you have both "nodejs" and "node".

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/sass/node-sass/issues/1527#issuecomment-246209287, or mute the thread https://github.com/notifications/unsubscribe-auth/AJ5Yr_AshvVBS0zyf7U71ybPdE8Ul-Otks5qpIGugaJpZM4IXt_L .

controversial avatar Sep 12 '16 01:09 controversial

npm rebuild node-sass didn't work for me either, but removing the node_modules directory entirely and then calling npm istall fixed it.

jurgenhaas avatar Nov 04 '16 12:11 jurgenhaas

I have the same probem, and with

rm node_module 
npm install
npm rebuild node-sass  

this work ok! tkx

PabloEzequiel avatar Jan 03 '17 04:01 PabloEzequiel

If is still not working, you can add manually the file : https://github.com/sass/node-sass/releases/tag/v4.2.0. This is what I did finally.

Assitan avatar Jan 10 '17 17:01 Assitan