Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Error: Missing binding #1527

Closed
danielbayley opened this issue May 5, 2016 · 15 comments
Closed

Error: Missing binding #1527

danielbayley opened this issue May 5, 2016 · 15 comments

Comments

@danielbayley
Copy link

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?

@nschonni
Copy link
Contributor

nschonni commented May 5, 2016

The Atom shell isn't supported, see #1047

@xzyfer
Copy link
Contributor

xzyfer commented May 5, 2016

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 xzyfer closed this as completed May 5, 2016
@danielbayley
Copy link
Author

danielbayley commented May 5, 2016

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?

@xzyfer
Copy link
Contributor

xzyfer commented May 10, 2016

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.

@szlike
Copy link

szlike commented Jul 15, 2016

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

@xzyfer
Copy link
Contributor

xzyfer commented Jul 19, 2016

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

@danielbayley
Copy link
Author

I open a discussion with the plugin authors

I am the plugin author… 😄

@padlock98
Copy link

padlock98 commented Jul 25, 2016

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.

@ifnull
Copy link

ifnull commented Aug 31, 2016

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.

@controversial
Copy link

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

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

> node-sass@3.9.3 install /var/www/nphs.social/node_modules/gulp-sass/node_modules/node-sass
> node scripts/install.js


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

@saper
Copy link
Member

saper commented Sep 11, 2016

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

@controversial
Copy link

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

On Sun, Sep 11, 2016 at 6:33 PM Marcin Cieślak notifications@github.com
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
#1527 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AJ5Yr_AshvVBS0zyf7U71ybPdE8Ul-Otks5qpIGugaJpZM4IXt_L
.

@jurgenhaas
Copy link

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

@PabloEzequiel
Copy link

PabloEzequiel commented Jan 3, 2017

I have the same probem, and with

rm node_module 
npm install
npm rebuild node-sass  

this work ok! tkx

@Assitan
Copy link

Assitan commented Jan 10, 2017

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.

@sass sass locked and limited conversation to collaborators Jan 10, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests