Node Sass could not find a binding for your current environment: Windows 64-bit with Node.js 12.x

access_time 10 months ago visibility2965 comment 0

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.
Like this article?
Share on

Please log in or register to comment.

account_circle Log in person_add Register

Log in with external accounts

Follow Kontext

Get our latest updates on LinkedIn or Twitter.

Want to publish your article on Kontext?

Learn more

More from Kontext

Bootstrap 4 Mega Full Width Dropdown Menu
visibility 2935
thumb_up 2
access_time 9 months ago

On Kontext, a full width mega dropdown menu is implemented using Bootstrap 4. If you'd like to implement similar menus, please follow these steps.  The following code snippets work with Bootstrap 4.4.1. It should also work with other 4.x versions but I didn't test it.  The new CSS class ...

visibility 8
thumb_up 0
access_time 24 days ago

In Visual Studio projects, Gulp can be used to manage web application client resources such as CSS, fonts, JavaScript files and images and so on. This article provides guidance about download Google fonts into your project automatically via Gulp as part of project build or pre-publish. Node.js ...

visibility 22
thumb_up 0
access_time 2 years ago

JSON is commonly used in modern applications for data storage and transfers. Pretty much all programming languages provide APIs to parse JSON.