How to fix libsass bindings not found

Arghhhh!

I feel like Node eats my nights for fun. Tonight I updated to Node v4.1.1 – brew upgrade node for those on OSX.

But then immediately I hit upon this:

[21:43:32] Error: `libsass` bindings not found in /Users/myusername/Development/my-project/node_modules/gulp-sass/node_modules/node-sass/vendor/darwin-x64-46/binding.node. Try reinstalling `node-sass`?
    at Object.sass.getBinaryPath (/Users/myusername/Development/my-project/node_modules/gulp-sass/node_modules/node-sass/lib/extensions.js:150:11)
    at Object.<anonymous> (/Users/myusername/Development/my-project/node_modules/gulp-sass/node_modules/node-sass/lib/index.js:16:36)
    at Module._compile (module.js:434:26)
    at Object.Module._extensions..js (module.js:452:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (/Users/myusername/Development/my-projectd/node_modules/gulp-sass/index.js:163:21)
    at Module._compile (module.js:434:26)

Sigh.

I then tried to brew upgrade libsass which threw back this:

Error: libsass 3.2.5 already installed

Anyway, after much back and forth, it turns out the solution was quite simple.

From your project directory:

rm -rf node_modules
npm install

🙂 Yes, whilst not exactly identifying the root cause, sometimes the blunt and brutal does the job better and faster than anything else.

Now, where was I? Oh yes… scratching my head over the next problem.

Published by

Code Review

CodeReviewVideos is a video training site helping software developers learn Symfony faster and easier.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.