5

I get following error message when running gulp:

Error: Missing binding Z:\Themewagon\Premium\sparrow\zcore\node_modules\node-sass\vendor\win32-x64-48\binding.node Node Sass could not find a binding for your current environment: Windows 64-bit with Node.js 6.x

Found bindings for the following Environments: Linux 64-bit with Node.js 7.x

To resolve this error I tried:

  1. npm install node-sass,
  2. npm rebuild node-sass,
  3. npm uninstall -save node-sass,
  4. npm install -save node-sass,
  5. npm cache clean. etc

Nothing is working for me. How do I resolve this issue.

Harshal Bhamare
  • 372
  • 1
  • 6
  • 17
Humayun Kabir
  • 518
  • 4
  • 15
  • Have you tried installing Node.js for Windows? If you are using Visual Studio 2015, see SO http://stackoverflow.com/questions/40846006/vs-task-runner-explorer-node-sass-could-not-find-a-binding – Doug Domeny Dec 05 '16 at 17:21
  • 1
    So while I'm not entirely certain just yet what is causing this issue, I did experianced it myself on osx exactly as you have describe it. That being said, there is quite a simple workaround for this issue, here is what you should do: For Node 6: - check the `\node_modules\node-sass\vendor` directory and see if there is either `win32-x64-48` [in case of windows], `darwin-x64-48` [in case of osx] or `linux-x64-48` [in case of linux]. If not, create them. Then -> continue in the next comment: – Bartekus Dec 07 '16 at 05:30
  • 1
    - Go to [node-sass-binaries](https://github.com/sass/node-sass-binaries) and download the binding file that's correspond to the directory folder that you just created, saving it as `binding.node` inside that same folder. Once this is done everything should work. Also in case of Node 7 use `*-x64-51` while for Node 5 use `*-x64-47` for folders along with appropriate `*-x64-*_binding.node` renamed to `binding.node` that you put inside the said folder. Cheers and good luck. Also if anybody else encounter this and knows what cause it, I'd be very happy to find out myself. – Bartekus Dec 07 '16 at 05:35
  • I didn't use **Visual Studio 2015**. By the way I solved it. Thanks. – Humayun Kabir May 31 '17 at 13:36
  • 2
    @Humayunkabir please add your findings as your own answer so we can solve it too! – Simon_Weaver Jun 02 '17 at 18:55
  • Possible duplicate of [Node Sass No Binding for Your current environment](https://stackoverflow.com/questions/43811639/node-sass-no-binding-for-your-current-environment) – John Oct 10 '17 at 14:00

1 Answers1

2

This happens when you have 2 versions of Node installed, add node-sass with one and run it for the other.

Example Visual Studio ships with Node 5 (at least VS2017 does). If you have installed another version of node (say v6) and install node-sass using that. When it installs it binds to the version to version 6. You can then never run gulp via Visual studio (under Node 5) it fails with the error.

To fix this you can make visual studio use the version you have installed on your system. Add the entry to top of the list to your node location:

enter image description here

John
  • 29,788
  • 18
  • 89
  • 130