Try reinstalling `node-sass` on node 0.12?
Asked Answered
E

17

269

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?

Executive answered 9/2, 2015 at 11:50 Comment(1)
Downgrading node worked for me.Yount
E
385

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
Eckert answered 19/9, 2015 at 8:54 Comment(14)
fixed problem form me on node 4.1 :) tyParapet
Fixed for me on Debian 8.1 and Node 4.1 too. Thanks a lot.Monarch
npm install --save-dev gulp-sass@3 did the job for me! :PTun
Thank you. Probably this answer should be marked as the "right one")Bowline
Thank you, spent a lot of time trying to resolve this and this was the solution that worked!Crystallize
This is the only solution working on node 4.2.3. Thanks!Nanny
Using Win 8 and node 4+. This is the only solution that works, tried them all, literalyDrayton
Yep this worked for me. Tried the other fixes such as rebuilding sass and none of them worked. I guess they're all related to different version of sass and node!Star
Thank you so much! Mac, node v4.2.6Cone
Thanks man! Just came across this issue and this fixed it for me :)Midnight
Thanks. Nice solution for Mac and node 5.8.Cumin
After running these commands, I had to run 'npm rebuild node-sass' then I was back in biz!Gondola
Note that you may have to run the sudo command in front of it for permission issues ;-)Zarf
Also solves the issue on v6.9.2 as of December 2016. Thanks!Spiegleman
S
341

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

Slingshot answered 6/5, 2015 at 4:13 Comment(6)
Got a lot of errors, like Python not supported by and Failed at the [email protected] install script 'node build.js'Ledaledah
This should be the accepted answer, because it does minimum work to fix the actual problem.Footwear
@AlikElzin-kilaka: Make sure that you have Python installed and the PYTHON environment variable set to point the installation.Rolon
I tried this before anything else and it worked perfectly. CheersPrefab
I receive a Error: Cannot find module 'node_modules/node-sass/node_modules/pangyp/bin/node-gyp'Secundines
Worked perfectly for me.Kloman
G
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.

Greensboro answered 10/3, 2015 at 21:40 Comment(7)
That won't work if you don't have all you dependencies specified in package.jsonWoehick
I had to delete the folder, then run npm install, then npm update. But this pointed me in the right direction. Thanks!Torn
Deleting the node_modules folder caused: Error: Cannot find module 'c:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js' when running npm update.Ledaledah
This is the drastic solution. Just use npm rebuild node-sass which is specifically for rebuilding the C++ addons.Titanium
I believe we ran into this problem with an internal project because of a node_modules directory that was accidentally committed along with the source into source control.Bristletail
Just running npm update worked for me. No need to delete anything.Infrared
It's a drastic solution but most people don't update their dependencies that often anyway - so this is a good practice to refresh where your project is at.Languorous
S
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

Search answered 15/9, 2015 at 18:25 Comment(1)
Worked Today for @lastest versionsArchilochus
H
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
[email protected] /var/www/myapp
└── [email protected]

$ 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
Heinrik answered 19/3, 2015 at 22:33 Comment(1)
For those of us using 'grunt-sass' be sure and update: 'npm install --save-dev grunt-sass'Petaloid
S
19

If you use Gulp then try:

npm install gulp-sass

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

Sogdian answered 6/5, 2015 at 14:16 Comment(2)
using this one after "npm uninstall --save-dev gulp-sass" fixed the problem for meDibbuk
npm install grunt-sass fixed the problem for me.Primero
V
11

i had the same problem today at work.

npm rebuild node-sass

done the job for me

Vivien answered 29/10, 2016 at 6:1 Comment(0)
P
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

Petaloid answered 25/2, 2015 at 16:26 Comment(4)
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"Affiliate
Downgrading node itself is more of a workaround than an answer.Heinrik
This bug is fixed in [email protected] as @Heinrik discovered at the end of the ticket referenced by this answer. See his comment in this thread.Petaloid
'grunt-sass' users should update after updating 'node-sass' if you're still experiencing trouble: 'npm install --save-dev grunt-sass'Petaloid
P
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.

Palikar answered 9/9, 2015 at 23:19 Comment(0)
A
2

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

Allonym answered 1/5, 2015 at 18:52 Comment(0)
E
2

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

Elaboration answered 12/11, 2015 at 16:5 Comment(0)
B
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.

Bolanos answered 19/1, 2016 at 18:10 Comment(0)
E
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

Erst answered 23/3, 2016 at 14:25 Comment(0)
I
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).

Invitation answered 4/8, 2015 at 18:10 Comment(0)
B
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!

Bebe answered 16/11, 2015 at 20:3 Comment(0)
C
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.

Cralg answered 16/3, 2016 at 14:28 Comment(0)
B
0

You need to use the right version. Try:

nvm use 0.12
Bryon answered 8/11, 2016 at 19:0 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.