7

I'm using Node.js 10 which is the recommended version and just trying to run a simple gulp task to compile some SCSS files. However, I am getting the following error.

Node Sass could not find a binding for your current environment: Windows 64-bit with Node.js 10.x Found bindings for the following environments: - Windows 64-bit with Node.js 8.x

Full error here

Failed to run "C:\Users\lee\Documents\Projects\Merch.Umb\Src\Merch.Web\Gulpfile.js"... cmd.exe /c gulp --tasks-simple C:\Users\lee\Documents\Projects\Merch.Umb\Src\Merch.Web\node_modules\node-sass\lib\binding.js:15
      throw new Error(errors.missingBinary());
      ^ Error: Missing binding C:\Users\lee\Documents\Projects\Merch.Umb\Src\Merch.Web\node_modules\node-sass\vendor\win32-x64-64\binding.node Node Sass could not find a binding for your current environment: Windows 64-bit with Node.js 10.x Found bindings for the following environments:
  - Windows 64-bit with Node.js 8.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.
    at module.exports (C:\Users\lee\Documents\Projects\Merch.Umb\Src\Merch.Web\node_modules\node-sass\lib\binding.js:15:13)
    at Object.<anonymous> (C:\Users\lee\Documents\Projects\Merch.Umb\Src\Merch.Web\node_modules\node-sass\lib\index.js:14:35)
    at Module._compile (internal/modules/cjs/loader.js:688:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
    at Module.load (internal/modules/cjs/loader.js:598:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
    at Function.Module._load (internal/modules/cjs/loader.js:529:3)
    at Module.require (internal/modules/cjs/loader.js:636:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Object.<anonymous> (C:\Users\lee\Documents\Projects\Merch.Umb\Src\Merch.Web\node_modules\gulp-sass\index.js:162:21)

Am I supposed to uninstall v10 and install an older version of Node.Js?

YodasMyDad
  • 9,248
  • 24
  • 76
  • 121
  • Have you tried to remove the node_modules folder and run `npm install`? – hutabalian Dec 06 '18 at 16:04
  • Possible duplicate of [Node Sass could not find a binding for your current environment](https://stackoverflow.com/questions/37986800/node-sass-could-not-find-a-binding-for-your-current-environment) – Zvi Redler Feb 27 '19 at 14:01

2 Answers2

3

I think this can solve you problem.

By going into project folder till the location of node-sass folder and then execute:

npm rebuild node-sass --force

Alternative is

Delete node-saas and Do

npm install

Code Maniac
  • 37,143
  • 5
  • 39
  • 60
1

Uninstall node and use Node.js version manager (nvm) for Windows to install the latest NodeJs version.

Delete node_modules and rebuild with npm install.