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

libsass binding not found #906

Closed
caseymorrisus opened this issue Apr 29, 2015 · 24 comments
Closed

libsass binding not found #906

caseymorrisus opened this issue Apr 29, 2015 · 24 comments

Comments

@caseymorrisus
Copy link

I've seen several threads elsewhere with this same issue, must have tried 20 solutions, none worked for me so far.

 "Uncaught Error: `libsass` bindings not found. Try rei nstalling `node-sass`?", source:     C:\Users\Casey\Electron\resources\app\node_modules\node-sass\lib\index.js (22)
@saper
Copy link
Member

saper commented Apr 29, 2015

What does npm install node-sass@beta say?

@caseymorrisus
Copy link
Author

Still getting the same error unfortunately. Also tried(with the same results):

npm uninstall node-sass
npm cache clean
npm install node-sass@beta

Error:

 "Uncaught Error: `libsass` bindings not found. Try reinstalling `node-sass`?", source: C:\Users\Casey\Electron\resources\app\node_modules\node-sass\lib\extensions.js (146)

@saper
Copy link
Member

saper commented Apr 29, 2015

Can you please post a full output of node install node-sass@beta to http://gist.github.com?

@caseymorrisus
Copy link
Author

Ahhh sorry for the misunderstanding. I assume you mean npm install node-sass@beta correct?

https://gist.github.com/caseymorrisus/27ea6ebe0ccc3493c2c4

@saper
Copy link
Member

saper commented Apr 29, 2015

Thanks. The above link indicates that node-sass is installing correctly in C:\Users\Casey\Electron\resources\app\node_modules\node-sass

@caseymorrisus
Copy link
Author

Any idea what could be causing the bindings not found error? Been working on fixing this for a few days.

@saper
Copy link
Member

saper commented Apr 29, 2015

I am sorry, you give too little information.

@caseymorrisus
Copy link
Author

Sorry about that, I'm not sure what you need to know. I'm currently trying to implement node-sass into my Electron (Atom Shell) project. Just trying to require('node-sass') produces the error I provided upon launching my application.

@saper
Copy link
Member

saper commented Apr 29, 2015

I don't think we provide binaries from the atom shell and the original binary file for Windows might not work.

@caseymorrisus
Copy link
Author

I am also running Windows 7 if that helps. I will test this out on OSX in ~1-2 hours to see if the problem exists there as well. Are you saying it won't be compatible with Windows & Atom? (I'm a little slow this morning)

@saper
Copy link
Member

saper commented Apr 29, 2015

See some discussion about atom shell compatibility: electron/electron#533 electron/electron#1002 nodejs/nan#226

If you run normal npm install node-sass@beta you are probably using normal node and npm and not their atom counterparts, that's why it works.

@xzyfer
Copy link
Contributor

xzyfer commented May 1, 2015

@caseymorrisus please produce the full output from the following commands https://gist.github.com/am11/e5de3c49c219f0811e1d

Make sure substitute npm install node-sass with npm install node-sass@beta

@saper
Copy link
Member

saper commented May 1, 2015

This PowerShell script might work just fine, as it uses normal node and npm. https://gist.githubusercontent.com/caseymorrisus/27ea6ebe0ccc3493c2c4/raw/f174f5f63a11b6ae556042e3f4a507354e64ae27/gistfile1.txt shows it installs just fine. We need to run it under atom shell, probably with apm or something. I don't know which engine atom shell uses, what is their module version number etc. I tried to compile atom shell but failed and gave up.

Somebody should step up and compile atom shell binaries and we should add them to the supported matrix. In the meantime @caseymorrisus might try to compile the binding from the source (Visual Studio and Windows SDKs are required). I guess that the binary path will be the same as for other engines, just linking to some atomized iojs library.

For now, the answer is, "we need help to run node-sass under atom shell".

@caseymorrisus
Copy link
Author

@xzyfer Headed out to work, will try this out on my windows machine when I get home.

@saper I could give it a go, but I'll admit I don't know much about compiling. I might try to ask around my network of friends to see if anyone is willing to give it a go.

@SerenadeX
Copy link

+1 on OS X. I gave it a shot running 3.0.0 and it won't launch because of that same error.

@xzyfer
Copy link
Contributor

xzyfer commented May 9, 2015

@SerenadeX please follow the steps in the troubleshooting guide exactly, and paste the output in a https://gist.gihtub.com.

https://github.com/sass/node-sass/blob/master/TROUBLESHOOTING.md#linuxosx

@benmirkhah
Copy link

I ended up with this bug after updating my node to the latest version,
I fond this thread and followed all the steps above to no result,
turns out the problem was gulp-sass, updating it to the newest version resolved it.

@Riuujin
Copy link

Riuujin commented Jun 19, 2015

I had the same problem when using visual studio task explorer, it appears visual studio comes with its own node version, always the 32-bit version even if you have node 64-bit version installed. Luckily in vs2015 you can set it to use the version from the PATH, see http://blogs.msdn.com/b/webdev/archive/2015/03/19/customize-external-web-tools-in-visual-studio-2015.aspx for more info)

@r3db
Copy link

r3db commented Jun 25, 2015

@Riuujin
👍 Fixed my problem!

@r3db
Copy link

r3db commented Jun 26, 2015

I don't know if it helps but in one of my machines none of the suggestions on this thread helped.
Until I ran.

npm install node-sass
npm rebuild node-sass

@xzyfer
Copy link
Contributor

xzyfer commented Jun 29, 2015

This appears to be resolved.

@xzyfer xzyfer closed this as completed Jun 29, 2015
@xzyfer
Copy link
Contributor

xzyfer commented Sep 15, 2015

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.

It's our fault for not producing a more useful error message. This will be
fixed.
On 15 Sep 2015 17:24, "Ash Connell" [email protected] wrote:

npm rebuild node-sass magically worked. No idea why


Reply to this email directly or view it on GitHub
#906 (comment).

@xzyfer
Copy link
Contributor

xzyfer commented Sep 16, 2015

A better error message will now be shown when this happens. #1148

Error: The libsass binding was found in /Users/michael/Projects/Sass/node-sass/vendor/darwin-x64-45/binding.node
This usually happens because your node version has changed.
Run npm rebuild node-sass to build the binding for your current node version.

@AshConnolly
Copy link

@r3db
Thanks! :D

jiongle1 pushed a commit to scantist-ossops-m2/node-sass that referenced this issue Apr 7, 2024
Remove hard-coded version from autotools build
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

8 participants