[node.js] Try reinstalling `node-sass` on node 0.12?

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?

This question is related to node.js sass gulp

The answer is


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.


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

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


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

You need to use the right version. Try:

nvm use 0.12

If you use Gulp then try:

npm install gulp-sass

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


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

I have node v5.5.0, npm 3.3.12


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


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


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.


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.


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.


i had the same problem today at work.

npm rebuild node-sass

done the job for me


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


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).


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!


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


Examples related to node.js

Hide Signs that Meteor.js was Used Querying date field in MongoDB with Mongoose SyntaxError: Cannot use import statement outside a module Server Discovery And Monitoring engine is deprecated How to fix ReferenceError: primordials is not defined in node UnhandledPromiseRejectionWarning: This error originated either by throwing inside of an async function without a catch block dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.62.dylib error running php after installing node with brew on Mac internal/modules/cjs/loader.js:582 throw err DeprecationWarning: Buffer() is deprecated due to security and usability issues when I move my script to another server Please run `npm cache clean`

Examples related to sass

Error: Node Sass version 5.0.0 is incompatible with ^4.0.0 How to fix ReferenceError: primordials is not defined in node Browserslist: caniuse-lite is outdated. Please run next command `npm update caniuse-lite browserslist` What is the difference between CSS and SCSS? Angular-cli from css to scss Why don’t my SVG images scale using the CSS "width" property? Angular CLI SASS options Error: Cannot find module 'gulp-sass' How to compile or convert sass / scss to css with node-sass (no Ruby)? Try reinstalling `node-sass` on node 0.12?

Examples related to gulp

How to fix ReferenceError: primordials is not defined in node Everytime I run gulp anything, I get a assertion error. - Task function must be specified Stylesheet not loaded because of MIME-type Node update a specific package 'gulp' is not recognized as an internal or external command How to watch and reload ts-node when TypeScript files change How to use npm with ASP.NET Core Expected linebreaks to be 'LF' but found 'CRLF' linebreak-style Gulp error: The following tasks did not complete: Did you forget to signal async completion? NPM vs. Bower vs. Browserify vs. Gulp vs. Grunt vs. Webpack