Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Node Sass No Binding for Your current environment

I've seen quite a few of these questions on SO, but none seem to solve or match the problem.
Node Sass could not find a binding for your current environment: Windows 64-bit with Node.js 6.x. The odd thing is, I don't have Node.js 6.x installed. From the command line, node -v gives me v5.10.1.

I'm the Angular4 Universal Asp.net core visual studio 2017 template straight out of the box.

I've tried

  • npm rebuild node-sass --force
  • Reordering node in Web External toolsin Visual Studio

    fail: Microsoft.AspNetCore.Server.Kestrel[13] Connection id "0HL4JSD9SSV8E": An unhandled exception was thrown by the application. System.Exception: Call to Node module failed with error: Prerendering failed because of error: Error: Module build failed: Error: Missing binding D:\Projects\angular2\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:

    • Windows 64-bit with Node.js 5.x

    This usually happens because your environment has changed since running npm install. Run npm rebuild node-sass --force to build the binding for your current environment. at module.exports (D:\Projects\angular2\node_modules\node-sass\lib\binding.js:15:13) at Object. (D:\Projects\angular2\node_modules\node-sass\lib\index.js:14:35)

Where have I gone wrong?

like image 807
Darthg8r Avatar asked May 05 '17 18:05

Darthg8r


3 Answers

On Visual Studio 2017 (15.4.1) you should go to:

  • Tools > Configure External Tools > Projects and Solutions > Web Package Management > External Web Tools

Then reorder the tools as seen below.

External Web Tools

This worked for me.

like image 109
Davidson Sousa Avatar answered Sep 22 '22 00:09

Davidson Sousa


Deleting node_modules folder and re-installing npm modules using npm install worked for me.

like image 35
Sreekumar P Avatar answered Sep 25 '22 00:09

Sreekumar P


Visual Studio ships it's own version of Node embedded so that's why you see a mismatch. The TROUBLSHOOTING guide in the repo covers how to work around this https://github.com/sass/node-sass/blob/master/TROUBLESHOOTING.md#using-node-sass-with-visual-studio-2015-task-runner

like image 22
nschonni Avatar answered Sep 26 '22 00:09

nschonni