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.
Web package management - Visual Studio 2017
Now close all running tasks (if any)
Restart Visual Studio
Task runner explorer
I hope you find this post valuable. If you click the ad below I get paid by someone else and can continue to publish posts for free. I would appreciate it very much.