Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

'libsass bindings not found. Try reinstalling 'node-sass'? #918

Closed
Milkbone911 opened this issue May 1, 2015 · 69 comments
Closed

'libsass bindings not found. Try reinstalling 'node-sass'? #918

Milkbone911 opened this issue May 1, 2015 · 69 comments

Comments

@Milkbone911
Copy link

I'm having a problem when running the command gulp I keep getting this error:

Error: `libsass` bindings not found. Try reinstalling `node-sass`?
    at getBinding (/home/vagrant/Code/Auth/node_modules/gulp-sass/node_modules/n
ode-sass/lib/index.js:22:11)
    at Object.<anonymous> (/home/vagrant/Code/Auth/node_modules/gulp-sass/node_m
odules/node-sass/lib/index.js:188:23)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/home/vagrant/Code/Auth/node_modules/gulp-sass/index.
js:3:17)
    at Module._compile (module.js:456:26)

below is my package.json file:

{
  "private": true,
  "devDependencies": {
    "gulp": "^3.8.11",
    "gulp-autoprefixer": "^0.0.7",
    "gulp-sass": "^2.0.0-alpha.1",
    "gulp-util": "^3.0.4",
    "laravel-elixir": "*"
  }
}

anyone have any ideas or thoughts on what could be going on?

@saper
Copy link
Member

saper commented May 1, 2015

Which node? Which npm? Which platform, operating system?

@xzyfer
Copy link
Contributor

xzyfer commented May 4, 2015

Please follow the relevant in our Troubleshooting guide and reply if the problem persists.

@Milkbone911
Copy link
Author

ran through all the steps on the troubleshooting guide, and have provided the results below.

npm -v: 2.7.4
node -v: v0.12.2
node -p process.versions: { http_parser: '2.3',
                          node: '0.12.2',
                          v8: '3.28.73',
                          uv: '1.4.2-node1',
                          zlib: '1.2.8',
                          modules: '14',
                          openssl: '1.0.1m' }
node -p process.platform: win32
node -p process.arch: x64
.\node_modules\.bin\node-sass --version: 2.1.1

I'm still having this issue, hopefully we can get it resolved.

@saper
Copy link
Member

saper commented May 5, 2015

Running npm install as root?

@Milkbone911
Copy link
Author

Yes, even when installing from root, the problem still occurs.

@saper
Copy link
Member

saper commented May 5, 2015

Can you post a complete log to gist.github.com?

Can you try as a non-root user?

@Milkbone911
Copy link
Author

can't seem to find any log files to copy over. I've tried as both non-root and root.

@saper
Copy link
Member

saper commented May 5, 2015

Do you have a vendor subdirectory under node-sass? If yes, what's there?

@Milkbone911
Copy link
Author

there is a win32-x64-node-0.12 file, and in that is binding.node thats everything thats under the vendor file.

@chrishomer
Copy link

We ran into this when upgrading from 0.10.x to 0.12.2. Fixed by deleting the node_modules directory and then reinstalling from scratch with npm install.

@xzyfer
Copy link
Contributor

xzyfer commented May 5, 2015

@Milkbone since .\node_modules\.bin\node-sass --version isn't producing an error node-sass has installed fine. The appears to be with the version of gulp-sass you're using.

I can't find any reference to gulp-sass@^2.0.0-alpha.1. Please try a stable version.

@Milkbone911
Copy link
Author

Thanks for the extended support with this everyone, I really appreciate it. I searched through the gulp-sass github-discussion and it seems like gulp-sass 1.3.3 was one of the most stable builds available. I used npm uninstall gulp-sass then, npm install gulp-sass@1.3.3 --save-dev then ssh'd back into my vagrant/homestead vm and ran gulp and still received the following error

Error: `libsass` bindings not found. Try reinstalling `node-sass`?
    at getBinding (/home/vagrant/Code/Auth/node_modules/node-sass/lib/index.js:2
2:11)
    at Object.<anonymous> (/home/vagrant/Code/Auth/node_modules/node-sass/lib/in
dex.js:188:23)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/home/vagrant/Code/Auth/node_modules/gulp-sass/index.
js:3:17)
    at Module._compile (module.js:456:26)

@saper
Copy link
Member

saper commented May 5, 2015

So, do I understand this correctly - node-sass installed fine, it only happens when you run gulp?

Can you try running home/vagrant/Code/Auth/node_modules/node-sass/bin/node-sass and process some very simple document, like /* ..... */

@Milkbone911
Copy link
Author

Correct, everything installs with no errors. one I run gulp I get the error, do you think it could be a problem with gulp? and sure I can try and display the results here.

@saper
Copy link
Member

saper commented May 5, 2015

On Tue, 5 May 2015, Milkbone wrote:

Correct, everything installs with no errors. one I run gulp I get the error, do you think it could be a problem with gulp? and sure I can try and display the results here.

Most probably you have some node_modules with an older/wrong node-sass somewhere down there, and gulp pickes up that.

You can try

 node -e "console.log(require.resolve('node-sass'))"

to see where you current node-sass is.

@Milkbone911
Copy link
Author

here's what I get when I run that, it seems to the correct install

\Projects\Auth> node -e "console.log(require.resolve('node-sass'))"

\Projects\Auth\node_modules\node-sass\lib\index.js

@saper
Copy link
Member

saper commented May 5, 2015

On Tue, 5 May 2015, Milkbone wrote:

here's what I get when I run that, it seems to the correct install

\Projects\Auth> node -e "console.log(require.resolve('node-sass'))"

\Projects\Auth\node_modules\node-sass\lib\index.js

And what is in the \Projects\Auth\node_modules\node-sass\vendor ?

Does \Projects\Auth\node_modules\node-sass\bin\node-sass work?

@Milkbone911
Copy link
Author

Projects\Auth\node_modules\node-sass\vendor\win32-x64-node-0.12inside that is binding.node.

and no just running \Projects\Auth\node_modules\node-sass\bin\node-sass does not work, maybe im not understanding what your asking exactly? my apologize.

@saper
Copy link
Member

saper commented May 5, 2015

On Tue, 5 May 2015, Milkbone wrote:

Projects\Auth\node_modules\node-sass\vendor\win32-x64-node-0.12inside that is binding.node.

and no just running \Projects\Auth\node_modules\node-sass\bin\node-sass does not work, maybe im not understanding what your asking exactly? my apologize.

Does not work? An error message? It does say nothing and just waits?

Can you just type /* .... */ and give it enter and ctrl-z ?

@Milkbone911
Copy link
Author

here is whats I get

\Projects\Auth> \Projects\Auth\node_modules\node-sass\bin\node-sass /* .... */
The system cannot find the path specified.

@saper
Copy link
Member

saper commented May 5, 2015

what about \Projects\Auth\node_modules\node-sass\.bin\node-sass

(with a dot before bin)

@Milkbone911
Copy link
Author

Projects\Auth> \Projects\Auth\node_modules\node-sass\.bin\node-sass
The system cannot find the path specified.

same thing...

@saper
Copy link
Member

saper commented May 5, 2015 via email

@Milkbone911
Copy link
Author

this is whats in my node-sass file http://puu.sh/hCDmj/fef017598b.png

@saper
Copy link
Member

saper commented May 5, 2015

On Tue, 5 May 2015, Milkbone wrote:

this is whats in my node-sass file http://puu.sh/hCDmj/fef017598b.png

Can you do

  cd \Projects\Auth\node_modules\
  dir node-sass /s > contents.txt

and post 'contents.txt' to http://gist.github.com ?

@Milkbone911
Copy link
Author

https://gist.github.com/Milkbone/b78c658266b040358c85 hope it helps abit more.

@isochronous
Copy link

This is still happening on my machine. Windows Server 2012 R2 Standard, using the following package.json file:

{
  "name": "LaunchTechnologies.Web.LaunchSite",
  "version": "0.1.0",
  "description": "",
  "main": "gulpfile.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "gulp": "^3.9.0",
    "gulp-sass": "^2.0.4"
  }
}

And this is the error I'm getting:

D:\Projects\Launch\ai5\launchsite\source\LaunchTechnologies.Web.LaunchSite\node_modules\gulp-sass\node_modules\node-sass\lib\ext
    throw new Error(['`libsass` bindings not found in ', binaryPath, '. Try re
          ^
Error: `libsass` bindings not found in D:\Projects\Launch\ai5\launchsite\source\LaunchTechnologies.Web.LaunchSite\node_modules\g
vendor\win32-ia32-11\binding.node. Try reinstalling `node-sass`?
    at Object.sass.getBinaryPath (D:\Projects\Launch\ai5\launchsite\source\LaunchTechnologies.Web.LaunchSite\node_modules\gulp-s
xtensions.js:148:11)
    at Object.<anonymous> (D:\Projects\Launch\ai5\launchsite\source\LaunchTechnologies.Web.LaunchSite\node_modules\gulp-sass\nod
:16:36)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (D:\Projects\Launch\ai5\launchsite\source\LaunchTechnologies.Web.LaunchSite\node_modules\gulp-sass\ind
    at Module._compile (module.js:456:26)

Things I've tried with no success:

  1. Completely deleting the node_modules directory and doing a fresh npm install
  2. Doing a npm uninstall of gulp and gulp-sass, then a fresh npm install
  3. Doing a global install of node-sass, and doing a global uninstall of node-sass.
  4. Doing a npm rebuild node-sass from within the node_modules/gulp-sass directory
  5. Doing a npm install with node-sass@2, then node-sass@3 when that didn't work
  6. Banging my head repeatedly against my desk

I should mention that when I do the fresh npm install everything seems to install just fine with no errors. Whenever I do a npm rebuild node-sass it just tells me my existing binaries are fine.

@pflannery
Copy link

Windows 10 64bit
Node 0.12.7
Npm 2.11.3

I got this message today from inside the task runner built in with Visual Studio 2015.
But when I ran node-sass from a console it worked.

I had nodejs 0.12.7 64bit installed but turns out Visual Studio 2015 only runs as a 32bit process. So when I tried to run node-sass via VS 2015 it was trying to find the vendor\win32-ia32-11.bindings file which didn't exist. Instead I had the 64bit bindings file compiled via node-gyp.

I fixed my problem by uninstalling node js 64bit and installing nodejs 32bit version so now it works from within Visual Studio 2015 and the console :)

I'm not quite sure how this scenario happens but it seems that node-gyp was compiling the 64bit bindings but node when run under a 32bit process was trying to resolve the 32bit binding which didn't exist.

@saper
Copy link
Member

saper commented Aug 1, 2015 via email

@isochronous
Copy link

Hmmm, good to know. I'm was running the commands from a PowerShell console
within ConEmu, so I'll verify that it was running in x64 mode and then
report back.

On Sat, Aug 1, 2015, 3:26 PM Marcin Cieślak notifications@github.com
wrote:

I'm not quite sure how this scenario happens but it seems that node-gyp
was compiling the 64bit bindings but node when run under a 32bit process
was trying to resolve the 32bit binding which didn't exist.

you need bindings compiled to much your OS, architecture and the version
if node.
if you need to use node-sass across multiple engines, you need to download
bindings
for everybengine you are using. you can keep multiple versions in the
vendor directory,
and node-sass will pick up the right one.


Reply to this email directly or view it on GitHub
#918 (comment).

@saper
Copy link
Member

saper commented Aug 2, 2015

I would recommend not to use PowerShell because it recognizes any kind of output to the standard error channel as a fatal error of the executed subprocess (example issue causing the failure is: npm/npm#8841). Just try npm install node-sass with cmd.exe

@isochronous
Copy link

I'll try that, though this would be the first time in 3 years of using node
that powershell has gotten in the way.
On Sat, Aug 1, 2015 at 10:39 PM Marcin Cieślak notifications@github.com
wrote:

I would recommend not to use PowerShell because it recognizes any kind of
output to the standard error channel as a fatal error of the executed
subprocess (example issue causing the failure is: npm/npm#8841
npm/npm#8841). Just try npm install node-sass
with cmd.exe


Reply to this email directly or view it on GitHub
#918 (comment).

@saper
Copy link
Member

saper commented Aug 2, 2015 via email

@isochronous
Copy link

Just an update - I tried using both 64 and 32 bit cmd.exe instead of powershell with the same result. I did just realize that I'm using an old version of node (v0.10.28) so I'm going to update that and see if that makes any difference.

@isochronous
Copy link

Updated to v0.12.7 x64, still have the same issue after deleting node_modules and re-running npm install :(

@saper
Copy link
Member

saper commented Aug 4, 2015

I have not enough details to help. Can you dump a full log according to our TROUBLESHOOTING.md guide?

One thing that I noticed is that the system was trying to load 32-bit binding. That should work but I hope that is what is expected.

@isochronous
Copy link

Sure thing - I didn't update the error I was getting, but I opened both a 64-bit and 32-bit cmd side-by-side and tried everything in both of them just to make sure I was covering my bases. The binding it was attempting to use may have changed (that should show up in the logs I suppose) but the general error was the same.

@isochronous
Copy link

D:\LaunchSite>npm -v
2.11.3

D:\LaunchSite>node -v
v0.12.7

D:\LaunchSite>node -p process.versions
{ http_parser: '2.3',
  node: '0.12.7',
  v8: '3.28.71.19',
  uv: '1.6.1',
  zlib: '1.2.8',
  modules: '14',
  openssl: '1.0.1p' }

D:\LaunchSite>node -p process.platform
win32

D:\LaunchSite>node -p process.arch
x64

At this point I went into node_modules/gulp-sass and ran npm install node-sass.
There were no errors on install.

D:\LaunchSite\node_modules\gulp-sass\node_modules\node-sass>type package.json
{
  "name": "node-sass",
  "version": "3.2.0",
  "libsass": "3.2.5",
  /* snip */
}

D:\LaunchSite\node_modules\gulp-sass\node_modules\.bin>node-sass --version
node-sass       3.2.0   (Wrapper)       [JavaScript]
libsass         3.2.5   (Sass Compiler) [C/C++]

D:\LaunchSite\node_modules\gulp-sass\node_modules\.bin>node -p "console.log(require('node-sass').info)"
node-sass       3.2.0   (Wrapper)       [JavaScript]
libsass         3.2.5   (Sass Compiler) [C/C++]
undefined  // <-- what's this?

And here's the error when running from an 64-bit cmd.exe - though I notice it's
using the ia32 binding rather than the x64 binding, which seems like it could
be a (the?) problem:

D:\LaunchSite>gulp sass

Error: `libsass` bindings not found in D:\LaunchSite\node_modules\gulp-sass\node_modules\node-sass\vendor\win32-ia32-11\binding.node. Try reinstalling `node-sass`?
    at Object.sass.getBinaryPath (D:\LaunchSite\node_modules\gulp-sass\node_modules\node-sass\lib\extensions.js:148:11)
    at Object.<anonymous> (D:\LaunchSite\node_modules\gulp-sass\node_modules\node-sass\lib\index.js:16:36)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (D:\LaunchSite\node_modules\gulp-sass\index.js:163:21)
    at Module._compile (module.js:456:26)

@isochronous
Copy link

I should also mention that the troubleshooting guide says to go to https://github.com/sass/node-sass-binaries/tree/v , but that's a 404.

@saper
Copy link
Member

saper commented Aug 4, 2015

So gulp is making us believe we run on 32-bit node, while running on 64-bit?

@hexogen
Copy link

hexogen commented Aug 5, 2015

Had the same problem but on Ubuntu 14.04(vagrant laravel homestead) host was an Ubuntu 14.04 too.
Solved after apt-get update, apt-get upgrade, npm install with sudo permission.

@iGeordie
Copy link

iGeordie commented Aug 5, 2015

I'm also seeing the exact same error messages when using grunt and grunt-sass on windows.

Loading "sass.js" tasks...ERROR
>> Error: `libsass` bindings not found in D:\repos\test\node_modules\grunt-sass\node_modules\node-sass\vendor\win32-ia32-14\binding.node. Try reinstalling `node
-sass`?
Warning: Task "sass" failed. Use --force to continue.

@isochronous
Copy link

I don't know if it's gulp doing it or what. However! I can verify that downloading the "missing" ia32 binding file into the appropriate directory fixes the problem. I don't know exactly what is causing node-sass to try using the ia32 bindings, but since 64-bit is perfectly capable of running 32-bit apps, including both x64 and ia32 bindings seems to suffice for a workaround until the actual cause can be identified.

@saper
Copy link
Member

saper commented Aug 5, 2015

Are you using VisualStudio to run some tasks? I think it comes with 32-bit node.

@isochronous
Copy link

No, I'm running everything in a cmd.exe shell within ConEmu.
Edit: Ah, that question may not have been for me, but in case it was I'll leave this post here.

@ckihneman
Copy link

I just went through the process of updating node on my system via homebrew. This lead to this error message popping on me, and not letting me move forward. It seemed to come down to old versions of files floating around, and deleting my node_modules folder then running a fresh npm install after ensuring all packages were referencing their latest versions. Ran right through after that. Here are my steps.

Update node via homebrew:

brew update
brew doctor
brew upgrade node

I recommend using npm-check-updates to update your node modules to latest. Install it and run that command to do a dry run, then pass -u to actually update your package.json file.

Update your global modules: npm update -g

Delete your current node_modules folder.

Run npm install to get a fresh version of everything.

@isochronous
Copy link

I assume from the fact that you're using homebrew that you're on OSX. The
problem I'm having is on a x64 Windows Server 2012 R2 box, and it's been
confirmed by at least one other windows x64 user. I've already done
everything you mentioned except for the npm-check-updates step, because, in
this particular case, node-sass is just a dependency on another third party
package (gulp-sass). Regardless, at the time I reported this bug gulp-sass
was already using the most recent version of node-sass, so that wouldn't
have helped.

On Thu, Sep 10, 2015 at 7:36 PM Chris Kihneman notifications@github.com
wrote:

I just went through the process of updating node on my system via
homebrew. This lead to this error message popping on me, and not letting me
move forward. It seemed to come down to old versions of files floating
around, and deleting my node_modules folder then running a fresh npm
install after ensuring all packages were referencing their latest
versions. Ran right through after that. Here are my steps.

Update node via homebrew:

brew update
brew doctor
brew upgrade node

I recommend using npm-check-updates to update your node modules to
latest. Install it and run that command to do a dry run, then pass -u to
actually update your package.json file.

Update your global modules: npm update -g

Delete your current node_modules folder.

Run npm install to get a fresh version of everything.


Reply to this email directly or view it on GitHub
#918 (comment).

@xzyfer
Copy link
Contributor

xzyfer commented Sep 17, 2015

It looks like you're using a version of node-sass that doesn't support Node
4. Either down grade to an older version of nose or updated to a node-sass

= 3.3.2.
On 18 Sep 2015 08:42, "Steven Valladolid" notifications@github.com wrote:

I appreciate the continued attention this thread is receiving. I'm running
into similar issues with NVM using node v4.0.0 and npm 2.14.2 on OSX 10.9.5

make: *** [Release/obj.target/binding/src/binding.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/Users/[redacted]/ember_dev/projects/node_modules/ember-cli-sass/node_modules/broccoli-sass-source-maps/node_modules/node-sass/node_modules/pangyp/lib/build.js:272:23)
gyp ERR! stack at emitTwo (events.js:87:13)
gyp ERR! stack at ChildProcess.emit (events.js:172:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Darwin 13.4.0
gyp ERR! command "/Users/[redacted]/.nvm/versions/node/v4.0.0/bin/node" "/Users/[redacted]/ember_dev/projects/node_modules/ember-cli-sass/node_modules/broccoli-sass-source-maps/node_modules/node-sass/node_modules/pangyp/bin/node-gyp" "rebuild"
gyp ERR! cwd /Users/[redacted]/ember_dev/projects/node_modules/ember-cli-sass/node_modules/broccoli-sass-source-maps/node_modules/node-sass
gyp ERR! node -v v4.0.0
gyp ERR! pangyp -v v2.3.2
gyp ERR! not ok


Reply to this email directly or view it on GitHub
#918 (comment).

@saper
Copy link
Member

saper commented Sep 17, 2015

Somewhere in your system 64-bit and 32-bit environments got mixed. It is enough that even if you are certain you start in a 64-bit environment - something, somewhere (some stupid batch file for example) executes 32-bit node for you. We really depend on the process.arch variable from the node engine we run on to pick up a right binary.

Try logging node -p process.arch at various stages of your pipeline and see where it changes.

@saper
Copy link
Member

saper commented Sep 19, 2015

To everyone who has read up to this point:

This message means that you are using an outdated version of node-sass. You should try to use the newest version: just try the following command and try again:

 npm install node-sass

This is the end. Thank you for your attention! We love you.

@sass sass locked and limited conversation to collaborators Sep 19, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests