Node Sass could not find a binding for your current environment: Windows 64-bit with Node.js 12.x
After upgrading Visual Studio to 16.5.1, I encountered the following error in Task Runner Explorer:
***\Kontext.Web.Portals\node_modules\node-sass\lib\binding.js:15 throw new Error(errors.missingBinary()); ^ Error: Missing binding ***\Kontext.Web.Portals\node_modules\node-sass\vendor\win32-x64-72\binding.node
Node Sass could not find a binding for your current environment: Windows 64-bit with Node.js 12.x Found bindings for the following environments: - Windows 64-bit with Node.js 10.x This usually happens because your environment has changed since running `npm install`. Run `npm rebuild node-sass` to download the binding for your current environment.
To reproduce this error, I can also run the following command in PowerShell or Command Prompt under the context of the website folder:
node node_modules\gulp\bin\gulp.js --tasks-simple
Fix this error
To fix this error, I did the following:
- Uninstalled node.js
- Installed the latest LTS version (v12.16.1)
- Deleted the node_modules folder in my website folder (Kontext.Web.Portals).
- And then run the following command to reinstall all the dependent packages.
npm install
To verify the fix
Run the command which Visual Studio is calling and it prints the following output:
PS ***\Kontext.Web.Portals> node node_modules\gulp\bin\gulp.js --tasks-simple copy:font:material copy:font:fontawesome copy:font:summernote copy:bootstrap clean:js clean:js:editor clean:js:QRCode clean:fonts:fontawsome clean:fonts:summernote clean:css clean compile:scss min:css min:js min:js:editor min:js:QRCode min build default
In Visual Studio, Task Runner Explorer now also display correctly:
I can also run my frontend CSS/JavaScript build successfully.
copyright
This page is subject to Site terms.
comment Comments
No comments yet.