When working in a Visual Studio 2017 solution I started to get this problem when running sass.js task via task runner explorer.
>> File "ui\_checkout.scss" changed.
Loading "sass.js" tasks...ERROR
>> Error: Missing binding C:<path>\node_modules\node-sass\vendor\win32-x64-46\binding.node
>> Node Sass could not find a binding for your current environment: Windows 64-bit with Node.js 4.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.
Warning: Task "sass:dist" not found. Use --force to continue.
Aborted due to warnings.
Completed in 0.796s at Tue Mar 28 2017 13:44:11 GMT+0200 (Central Europe Summer Time) - Waiting...
When googling this problem I found this nice explanation by Ryan Hayes
However I ran into an issue today in which I updated Node.JS outside of Visual Studio, but since VS uses its own install that is separate from any outside installation, you can potentially run into a node_modules package dependency issue where one version of npm installs a package (which makes it rely on that version of Node/npm), and then you can’t run commands in the other version (they break).
Running npm install or npm rebuild node-sass –force, as the error message says, did not help.
How to solve it
- Open Visual Studio 2017
- Go to Tools -> Options…
- Go to Projects and Solutions -> Web Package Management
- move $(PATH) to the top of that list and close that window.
- Now close all running tasks (if any)
- Restart Visual Studio