Processing
 

libsass bindings not found when using node-sass in nodejs

05/04/2015 20:23#1

Joined at: 12 months ago

Post: 4

Thank: 0

Thanked: 0

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 npmjs.com 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.

14/04/2015 09:56Top#2

Joined at: 8 months ago

Post: 1

Thank: 0

Thanked: 0

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 
05/10/2015 10:19Top#3

Joined at: 8 months ago

Post: 1

Thank: 0

Thanked: 0

If you're using node 4.x or later then you need to reinstall gulp-sass with:

npm uninstall --save-dev gulp-sass npm install --save-dev gulp-sass@2 
08/07/2015 20:19Top#4

Joined at: 8 months ago

Post: 1

Thank: 0

Thanked: 0

I fixed this issue by deleting the existing /node_modules folder and running npm update

02/10/2015 18:53Top#5

Francesco

Member

Joined at: 12 months ago

Post: 26

Thank: 0

Thanked: 0

This workaround (http://forum.ionicframework.com/t/error-running-gulp-sass/32311/20) worked form me.

Starting with this setup:

Cordova CLI: 5.3.3 Gulp version: CLI version 3.9.0 Gulp local: Local version 3.9.0 Ionic Version: 1.1.0 Ionic CLI Version: 1.6.5 Ionic App Lib Version: 0.3.9 ios-deploy version: Not installed ios-sim version: 5.0.1 OS: Mac OS X Yosemite Node Version: v4.1.1 Xcode version: Xcode 6.4 Build version 6E35b

I've found a solution to avoid to use 'sudo' command. We need before to fix npm permissions following this: https://docs.npmjs.com/getting-started/fixing-npm-permissions and fixing permissions for Node here: http://mawaha.com/permission-fix-node-js/ After this we can check and reinstall software without 'sudo' for npm, n or ionic.

I followed this step:

npm install -g n rm -R node_modules/  npm install node-sass@3.3.3  npm -g install node-gyp@3 npm uninstall gulp-sass npm install gulp-sass@2  npm rebuild node-sass  ionic setup sass  

Why node-sass@3.3.3? Because it works with latest ionic version: https://github.com/driftyco/ionic/pull/4449

22/02/2016 11:31Top#6

Joined at: 12 months ago

Post: 8

Thank: 0

Thanked: 0

This is the only solution that worked for me,

sudo npm install -g n sudo n 0.12.7 sudo npm install node-sass@2 sudo npm -g install node-gyp@3 sudo npm rebuild node-sass 
18/09/2015 23:27Top#7

Joined at: 8 months ago

Post: 1

Thank: 0

Thanked: 0

My solution was to downgrade to v0.10.25 (try sudo n 0.10.25 if you use n)

04/08/2015 18:08Top#8

Alan H.

Member

Joined at: 12 months ago

Post: 5

Thank: 0

Thanked: 0

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.

04/04/2016 18:11Top#9

Joined at: 8 months ago

Post: 1

Thank: 0

Thanked: 0

This was a Node version issue for me, try using nvm to backtrack your version to something like: 0.10.32. This worked for me. I was running 4.2.2

26/03/2016 10:36Top#10

worldask

Member

Joined at: 11 months ago

Post: 2

Thank: 0

Thanked: 0

I solved this problem by updating my gcc from 4.4.x to 4.7.x

23/06/2016 20:48Top#11

Joined at: 8 months ago

Post: 1

Thank: 0

Thanked: 0

I have solved this to create the right directory with the specified binding.node file. You can download the bindings from github

https://github.com/sass/node-sass-binaries

Look in the error message the path where it tries to find the binding. In my case:

C:\Users\Martijn\Documents\node_modules\gulp-sass\node_modules\node-sass\vendor\win32-x64-46

So I create this map win32-x64-46 and copy the binding from github in.

01/08/2016 18:56Top#12

Joined at: 12 months ago

Post: 7

Thank: 0

Thanked: 0

For anyone running into this issue in 2016. You have to downgrade your NPM then rebuild your node-sass - npm rebuild node-sass

Similar articles

Non-interactive method for dpkg-reconfigure tzdata

5 years ago - Reply: 3 - Views: 143

monit is not able to read mongod.lock

2 years ago - Reply: 3 - Views: 141

Ubuntu: hadoop command not found

2 years ago - Reply: 4 - Views: 244

C# Mono Console.ReadLine quitting

4 years ago - Reply: 1 - Views: 87

linking jsoncpp on Ubuntu

2 years ago - Reply: 1 - Views: 6

Build artifacts over ssh jenkins - PHP

3 years ago - Reply: 1 - Views: 38

Can't load Metasploit after installation

3 years ago - Reply: 5 - Views: 222

Selenium FirefoxDriver in Headless get error

2 years ago - Reply: 1 - Views: 97

Unable to start MongoDB. ERROR: addr already in use

2 years ago - Reply: 2 - Views: 120

ZSH Agnoster Theme showing machine name

2 years ago - Reply: 4 - Views: 250

Unable to start firefox browser with jenkins user

2 years ago - Reply: 2 - Views: 113

vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re