libsass bindings not found when using node sass in nodejs

libsass bindings not found when using node sass in nodejs  using -'node.js,ubuntu,npm,libsass,node-sass'

I want to use the node-sass module in my node.js v0.12 application to benefit from the performance of libsass.
I executed npm i node-sass to install the module, no errors so far.

Now the mess starts:
If I just open the REPL in a terminal to try out node-sass then everything works fine but if I include it in my project files and run node myfile.js then I get the following error message:

Error: `libsass` bindings not found. Try reinstalling `node-sass`?

The module's description at states that there might be a problem with resolving #!/usr/bin/env node under Ubuntu and how to fix this but that is not the case on my machine.
I could not find anything useful so I hope that you might help me.

I'm using node v0.12.2 under Ubuntu 14.10.

P.S.: I already tried to reinstall node-sass but without success. Nothing changes.

asked Sep 24, 2015 by santosh soni
0 votes

2 Answers

0 votes

For me, this issue was caused in my build system (Travis CI) by doing something kind of dumb in my .travis.yml file. In effect, I was calling npm install before nvm use 0.12, and this was causing node-sass to be built for 0.10 instead of 0.12. My solution was simply moving nvm use out of the .travis.yml file’s before_script section to before the npm install command, which was in the before_install section.

answered Sep 24, 2015 by tejas lakhani
0 votes

You’ve probably tried to reinstall node-sass while using npm install node-sass or (npm uninstall node-sass; npm install node-sass), but node-sass is a C version of Sass. You have to use npm rebuild npm rebuild node-sass.

This works for me.

answered Sep 24, 2015 by santosh soni