Node Sass could not find a binding for your curren

2019-01-12 13:28发布

I am having issues building an app because node-sass keeps failing with the error.

ERROR in Missing binding /Users/warren/Sites/random-docs/my-cms/node_modules/node-sass/vendor/darwin-x64-11/binding.node
Node Sass could not find a binding for your current environment: OS X 64-bit with Node 0.10.x

I have tried running

npm rebuild node-sass

which says

Binary is fine; exiting.

When running node -v I get v6.2.2

Which is different to what the sass error says "Node 0.10.x". I cant figure out why it is getting the wrong version. I have also tried removing the node_modules folder and running npm update or npm install, both of which did not resolve the issue. Any ideas?

标签: node.js npm
30条回答
Viruses.
2楼-- · 2019-01-12 14:02

Note I'm using VS 2015, 64-bit Windows 7.

Also works for VS 2017 (from replies to this post)

Task Runner Explorer can't load tasks

For VS 2015

  • Go to: Tools > Options > Projects and Solutions > External Web Tools

For VS 2017(.3)

  • Tools > Options > Projects and Solutions > Web Package Management > External Web Tools (per @nothrow)

In VS 2017, you also need to put $(PATH) above $(VSINSTALLERDIR)\Web\External


  • Reorder so that $(PATH) is above $(DevEnvDir)\Extensions\Microsoft\Web Tools\External

enter image description here


Deleting node_modules and running npm install and then npm rebuild node-sass did nothing.

查看更多
Evening l夕情丶
3楼-- · 2019-01-12 14:02

This worked for me Deleting node_modules and then restoring packages from IDE and then npm rebuild node-sass

查看更多
\"骚年 ilove
4楼-- · 2019-01-12 14:03

For people that switched to nvm from system node, if you haven't removed the ~/.npm and ~/.node-gyp folder this problem can arise since perhaps the node version within ~/.node-gyp could be different.

In any case those folders should be removed.

查看更多
Anthone
5楼-- · 2019-01-12 14:04

I had the same problem

    throw new Error(errors.missingBinary());
    ^

Error: Missing binding /path/to/project/node_modules/node-sass/vendor/linux-x64-47/binding.node
Node Sass could not find a binding for your current environment: Linux 64-bit with Node.js 5.x

Found bindings for the following environments:
  - Linux 64-bit with Node 0.10.x
  - Linux 64-bit with Node.js 5.x

That was because I did npm install using a different nodejs version, try deleting node_modules folder installing and starting

cd your_proyect
rm -rf node_modules
npm install
npm start or gulp or whatever

If you are using nvm do

nvm use stable // or your favorite version
// remove node_module directory
npm install
npm start or gulp or whatever
查看更多
小情绪 Triste *
6楼-- · 2019-01-12 14:05

I had to first choose the new default node version nvm use *** or nvm install *** and then remove all in node_modules in the project and npm i again.

查看更多
何必那么认真
7楼-- · 2019-01-12 14:06

For Visual Studio 2015/2017, Right Click on your package.json and Click on Restore Packages.

This will make sure that the npm from the Visual Studio Tools External Tools is run and the binding will be rebuild based on that.

查看更多
登录 后发表回答