Libsass bindings not found

Hi!

We are using Sage since a few months to create our own themes and it is a great tool!

Unfortunately, we are facing some errors that we dont know how to solve.

We are a small team of four persons and with some of our projects, when some of us would like to use gulp watch, they get the following error :

Z:\lhc2015\www\wp-content\themes\lhc\node_modules\gulp-sass\node_modules\node-sass\lib\extensions.js:148
	throw new Error(['`libsass` bindings not found in ', binaryPath, '. Try reinstalling `node-sass`?'].join(''));
	^

Error: `libsass` bindings not found in Z:\lhc2015\www\wp-content\themes\lhc\node_modules\gulp-sass\node_modules\node-sass\vendor\win32-x64-46\binding.node. Try reinstalling `node-sass`?
	at Object.sass.getBinaryPath (Z:\lhc2015\www\wp-content\themes\lhc\node_modules\gulp-sass\node_modules\node-sass\lib\extensions.js:148:11)
	at Object.<anonymous> (Z:\lhc2015\www\wp-content\themes\lhc\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> (Z:\lhc2015\www\wp-content\themes\lhc\node_modules\gulp-sass\index.js:163:21)
	at Module._compile (module.js:434:26)

The same problem happens also if we update everything (node.js, npm, bower, gulp), start a brand new project and go back to an older project.

We tried many things : clean and re-install everything, clear cache, re-install node modules, but it didn’t work (even npm install node-sass).

Can someone tell us what we are currently doing wrong? It will be much appreciated.

Many thanks.

Have you tried Googling your error? I just did, and came across one of our own issues:

https://github.com/roots/sage/issues/1309#issuecomment-73440662

I’ve recently encountered a similar Libsass error after upgrading to Node v 4.1.0, Gulp v3.9 and NPM v2.14.3. I found after clearing cache, running npm install and bower install helped clear some of my errors, but wasn’t enough. I also had to run npm install gulp-sass separately. To be honest, the steps I took to make it working again are a bit fuzzy.

I think the issue had something to do with Bootstrap during build. Also, if you’re not pulling from Sage repo, be sure to check your package.json and bower.json against the repo since it was updated recently.

Hi!

Many thanks for your answers! :smile:

Yes, we have Googled our error many times but without finding anything satisfying.

So, as you requested, we have the following versions:
Node : 4.1.1
NPM : 3.3.4
Bower : 3.9.0

Finally, we managed to make gulp watch work with an old and a new project by doing this:

  • Install the latest version of npm by using npm install -g npm@latest
  • Clearing cache in the specific theme’s folder with npm cache clear then remove the node_modules directory (we are under Windows, so instead of rm -rf node_modules, we installed and used RimRaf - https://github.com/isaacs/rimraf)
  • Use npm install
  • Run bower install
  • Use npm install gulp-sass separately

For now, everything seems to work but we will see how it works with another project.

This worked for me under the same circumstances caused by an upgrade to OSX El Captian

In my case I had to agree with the updated Xcode license agreement first.
I got this error when re-installing npm:

Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo.

I have a theme that was built using Sage 8.1.0, so using LESS instead of SASS. It all worked at the time, but now going back to edit it, after working on several other sites in the meantime using newer versions of Sage, I can’t get the css & js to be created in dist - I get the “Error: ‘libsass’ bindings not found. Try reinstalling ‘node-sass’?” error.

I’ve gone through all the suggestions in this post and those from the posts linked within, but nothing works to get this to run.

Is there a way of dealing with older versions of Sage and the various dependencies that are using newer versions than what Sage 8.1.0 required?

I’m running on:
Windows 10
node v4.1.1
npm v3.3.9
bower v.1.6.5

My most recent attempt was to:
rimraf node_modules
npm cache clear
npm install
bower install
npm uninstall node-sass
npm install node-sass@2.0.0 <-- the version used in gulp-sass 1.3.3 called in package.json

After running gulp, I still get the libsass error:

Error: libsass bindings not found. Try reinstalling node-sass?
at getBinding (E:\Projects\www.site.dev\wp-content\themes\mytheme\node_modules\gulp-sass\node_modules\node-sass\lib\index.js:22:11)
at Object. (E:\Projects\www.site.dev\wp-content\themes\mytheme\node_modules\gulp-sass\node_modules\node-sass\lib\index.js:188:23)
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. (E:\Projects\www.site.dev\wp-content\themes\mytheme\node_modules\gulp-sass\index.js:3:17)
at Module._compile (module.js:434:26)

I really don’t want to have to port the theme over to the current version of Sage if there’s a way of getting this to actually work.

Thanks in advance for any suggestions.

I was in a similar situation and after some searching finally found out it was due to me using Node 4. Running this fixed my build problems:

npm uninstall --save-dev gulp-sass
npm install --save-dev gulp-sass@2

This solved the issue for me, after updating to the most recent version on Node.js, however I also had to run:
npm rebuild node-sass

before I was fully up and running again