266

I would like to use google web starter kit. I installed node.js v0.12.0, node-sass & gulp.

And then ran:

$ sudo npm install

When I typed gulp serve then got this error:

Using gulpfile ~/web-starter-kit/gulpfile.js Starting 'styles'... 'styles' errored after 93 ms 
Error: `libsass` bindings not found. Try reinstalling `node-sass`? at getBinding

I reinstalled node and gulp but this doesn't help.

What should I do next?

mikemaccana
  • 81,787
  • 73
  • 317
  • 396
Takagi Akihiro
  • 2,661
  • 2
  • 9
  • 5

17 Answers17

386

If your node version is 4 and you are using gulp-sass, then try

npm uninstall --save-dev gulp-sass

npm install --save-dev gulp-sass@2
Roma Rush
  • 4,148
  • 1
  • 14
  • 15
340

I found this useful command:

npm rebuild node-sass

From the rebuild documentation:

This is useful when you install a new version of node (or switch node versions), and must recompile all your C++ addons with the new node.js binary.

http://laravel.io/forum/10-29-2014-laravel-elixir-sass-error

Denis C de Azevedo
  • 5,971
  • 2
  • 28
  • 46
233

I ran into this error using node 0.12.0 and it was fixed by deleting the existing /node_modules directory and running npm update.

createbang
  • 2,433
  • 1
  • 11
  • 13
84

npm rebuild node-sass was giving me errors (Ubuntu) and npm install gulp-sass didn't make the error go away.

Saw a solution on GitHub which worked for me:

npm uninstall --save-dev gulp-sass

npm install --save-dev gulp-sass

Pupper
  • 2,225
  • 2
  • 20
  • 28
22

I had the same issue:

  • installing node-sass
  • being told at the end of installation that the installation completed successfully
  • then being asked to re-install node-sass.

The solution is to install node-sass version 2 which supports current versions of node. See https://github.com/sass/node-sass/issues/490#issuecomment-70388754

Run:

npm install node-sass@2

Then re-test:

$ npm ls node-sass
myapp@0.0.0 /var/www/myapp
└── node-sass@2.0.1

$ gulp sass
[09:48:42] Using gulpfile /var/www/myapp/gulpfile.js
[09:48:42] Starting 'sass'...
[09:48:42] Finished 'sass' after 15 ms
mikemaccana
  • 81,787
  • 73
  • 317
  • 396
19

If you use Gulp then try:

npm install gulp-sass

I had the same problem and the gulp-sass package was the problem.

georger
  • 1,310
  • 19
  • 23
11

i had the same problem today at work.

npm rebuild node-sass

done the job for me

bin2hex
  • 307
  • 2
  • 13
9

Downgrading Node to 0.10.36 should do it per this thread on the node-sass github page: https://github.com/sass/node-sass/issues/490#issuecomment-70388754

If you have NVM you can just:

nvm install 0.10

If you don't, you can find NVM and instructions here: https://www.npmjs.com/package/nvm

natepers
  • 524
  • 4
  • 12
  • solved the issue for me. nvm is also available via homebrew for mac users: "brew install nvm". after switching to the 0.10.36 version, make sure it is really active: "node -v" – cjoy Mar 11 '15 at 18:43
  • 9
    Downgrading node itself is more of a workaround than an answer. – mikemaccana Mar 24 '15 at 10:05
  • 1
    This bug is fixed in node-sass@2.0.1- as @mikemaccana discovered at the end of the ticket referenced by this answer. See his comment in this thread. – natepers Apr 06 '15 at 20:41
  • 1
    'grunt-sass' users should update after updating 'node-sass' if you're still experiencing trouble: 'npm install --save-dev grunt-sass' – natepers Apr 08 '15 at 19:57
3

This answer is a bit orthogonal to the the OP, but --

libsass bindings don't install properly with the node-sass wrapper on Node v4.0.0. I got the same error message as in the question (Error: 'libsass' bindings not found. Try reinstalling 'node-sass') but I ended up uninstalling Node v4.0.0 and installing v0.12.7 using nvm, via this script:

https://gist.github.com/brock/5b1b70590e1171c4ab54

and now libsass and node-sass are behaving properly.

ericsoco
  • 20,453
  • 20
  • 89
  • 117
2

you may also want to npm remove gulp-sass and re-install gulp-sass if you've switched node versions.

4m1r
  • 10,632
  • 8
  • 40
  • 51
2

I have same issue when gulp-sass version is 1.3.0, and fix it after upgrading to 2.1.0.

Kos
  • 61
  • 6
1

If you came here because you upgraded nodejs systemwide & suddenly your emberjs ^1.13 app is failing with this message, make sure you're not using an outdated version of ember-cli-sass. You'll need to rm -rf node_modules bower_components dist tmp within the Ember app, then update your package.json with the appropriate ember-cli-sass version, and finally npm install --save-dev. This fixed it for me, without having to rebuild or change any other dependencies.

handwovensole
  • 214
  • 3
  • 11
1

I removed all the /node_modules folder then ran npm install and it worked.

I have node v5.5.0, npm 3.3.12

Florin Dobre
  • 8,025
  • 2
  • 45
  • 68
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.

In your case, it is likely that whatever process you are starting with gulp is using a different version of node (than what you would expect).

Alan H.
  • 15,001
  • 14
  • 74
  • 104
0

I had the same issue as @Kos had, only for some reason I had to modify the gulp-sass package from the old package.json file I had. It then installed the dependencies currently and now it finally works!

Shay
  • 1,812
  • 2
  • 14
  • 22
0

My issue was that I was on a machine with node version 0.12.2, but that had an old 1.x.x version of npm. Be sure to update your version of npm: sudo npm install -g npm Once that is done, remove any existing node-sass and reinstall it via npm.

k00k
  • 15,534
  • 13
  • 54
  • 82
0

You need to use the right version. Try:

nvm use 0.12
alexfigtree
  • 1,238
  • 12
  • 16