268
votes
E:\A Prem World\Team_Work_Tasks\Anjali\Anjali_20160524\QuizApp_20160524_01_Anj>ionic serve -l
(node:4772) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
There is an error in your gulpfile:
Error: Node Sass does not yet support your current environment: Windows 64-bit with false
For more information on which environments are supported please see:
TODO URL
    at Object.<anonymous> (E:\A Prem World\Team_Work_Tasks\Anjali\Anjali_20160524\QuizApp_20160524_01_Anj\node_modules\node-sass\lib\index.js:12:11)
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:456:32)
    at tryModuleLoad (module.js:415:12)
    at Function.Module._load (module.js:407:3)
    at Module.require (module.js:466:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (E:\A Prem World\Team_Work_Tasks\Anjali\Anjali_20160524\QuizApp_20160524_01_Anj\node_modules\gulp-sass\index.js:187:21)
    at Module._compile (module.js:541:32)
28
run npm rebuild node-sass or sudo npm rebuild node-sass - youhans

28 Answers

364
votes

This error message does not indicate a problem with Ionic, but rather with node-sass, which is specified to execute in your Gulp file.

The node-sass error:

Node Sass does not yet support your current environment

indicates that the version of node-sass you are trying to run is not compatible with the version of node installed.

Check the Node Sass release notes for the version of node-sass you have, to see which version of node is required.

If the version of node is wrong, you must downgrade node, or upgrade node-sass, until you have a compatible pair. If the node version is supported, you may just need to run:

npm rebuild node-sass

(with -g if node-sass was installed globally).

If that doesn't work, you can:

npm uninstall node-sass && npm install node-sass

(again, with -g if necessary).

This github issue has lots of more info on this.

88
votes

npm uninstall node-sass && npm install node-sass is the better way to fix

28
votes

Working for me only after installing Python 2.7.x (not 3.x) and then npm uninstall node-sass && npm install node-sass like @Quinn Comendant said.

22
votes

Removing node_modules and running npm install fixed those errors for me.

Others say: npm rebuild node-sass or npm audit fix might help.

17
votes

None of the above worked for me. I completely removed and than re-installed and it solved the issue.

To delete existing:

npm uninstall --save-dev node-sass 

Then to re-install:

npm install --save-dev node-sass
8
votes

I tried this but it didn't work for me and threw errors:

npm --depth 9999 update 
npm rebuild node-sass

I have installed the latest Node.js (which for the moment is 11.11.0 Current), after facing this problem I just did the following:

  1. downgrade to recommended version (which for the moment is 10.15.3 LTS)
  2. deleted node_modules and
  3. then reinstall yarn:
     yarn install
     yarn start

After executing these commands everything is working fine for me.

6
votes

Here are node and node-sass compatible versions list.

NodeJS  Supported node-sass version *
Node    15        5.0+   
Node    14        4.14+ 
Node    13        4.13+, < 5.0   
Node    12        4.12+  
Node    11        4.10+, < 5.0   
Node    10        4.9+   
Node     8        4.5.3+, < 5.0  
Node  <  8   <    5.0     < 57

If issue exists, upgrade or downgrade versions.

5
votes

Ran into this issue, npm i @ionic/app-scripts was the only thing that worked.

5
votes

Check the Node Sass release notes for the version of node-sass you have, to see which version of node is required. If the version of node is wrong, you must downgrade node, or upgrade node-sass, until you have a compatible pair. If the node version is supported, you may just need to run npm rebuild node-sass.If that doesn't work, you can npm uninstall node-sass or npm install node-sass

4
votes

rolling back to node v10.17.0 fixed the problem to me.

You can use nvm to do so:

https://github.com/nvm-sh/nvm

> nvm install 10.17.0
> nvm use 10.17.0
> node -v
10.17.0
4
votes

for visual studio 2019 need change MSBuild path

npm config set msvs_version 2017

npm config set msbuild_path "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\MSBuild.exe"

npm rebuild node-sass
3
votes

Try this:

npm --depth 9999 update
npm rebuild node-sass
3
votes

In my situation problem was in the version of node. As I used the newest version 16.0.0 but the version of node-sass was old (4.14.1), I downgraded node to 14.15.5 (nvm install 14.15.5), ran npm install [email protected], rebuilt node npm rebuild node-sass and just then started my app npm start. Worked!

Steps:

  1. nvm install 14.15.5 (downgrade node to version that satisfies node-sass)
  2. nvm use 14.15.5
  3. npm install [email protected] (reinstall node-sass)
  4. npm rebuild node-sass
  5. npm start
2
votes

The link from the stack trace below helped me in resolving this issue.

Module build failed: Error: Node Sass does not yet support your current environment: Windows 64-bit with Unsupported runtime (64)
For more information on which environments are supported please see:
https://github.com/sass/node-sass/releases/tag/v4.7.2

This link(https://github.com/sass/node-sass/releases/tag/v4.7.2) clearly shows node versions which are supported.

    OS      Architecture    Node
    Windows x86 & x64       0.10, 0.12, 1, 2, 3, 4, 5, 6, 7, 8, 9
    ...     ...             ...    

After downgrading the node version to 8.11.1, executed npm install again. Got the following message.

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

Found bindings for the following environments:
  - Windows 64-bit with Unsupported runtime (64)

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.

Finally,ran npm rebuild node-sass --force as instructed and all started working

2
votes

I got this error, with angular 7, what helped me is, From the windows power shell I run the command:

npm install --global --production windows-build-tools

then again I reopen my VS Code, on it's terminal I run the same command npm uninstall node-sass and npm install node-sass

2
votes

I had the same problem and I solved it as follows:

  1. check the node-sass version used in the current project

  2. go to node-sass release: "https://github.com/sass/node-sass/releases/tag/v@.@.@" (put your node-sass version here)

  3. check the Supported Environment table and see if your Node version exist in it

  4. if it is not, downgrade your node version to the latest version existing in the table

I know it's not the perfect solution but I didn't find anything else in my case.

2
votes

I had a similar error with the sass package, I fixed it by following the steps:

After having identified that the error was due to the incompatibility of the versions, list the available ones:

npm view node-sass versions

enter image description here

I had the version '5.0.0', so I proceeded to downgrade it to the previous one ('4.14.1' in my case):

npm uninstall node-sass

npm install [email protected]

And voila, only one version step was necessary, in other cases it may be several depending on the age or needs of the project.

2
votes

Please try this once if the above answers not fixed your issue

npm uninstall node-sass
npm install [email protected]

Source: here

1
votes

In my case the issue was when I installation of the node latest version i.e; 10.6.0. The same error was showing and with reference to @Quinn Uninstalled that version and installed the 8.11.3 LTS version. Now working Fine :)

0
votes

I got this error when I updated node using NVM. to remove this run; npm rebuild node-sass

0
votes

In my case, it was related to the node version.

My project was using 12.18.3 but I was on 14.5.0

So npm rebuild node-sass didn't solve the issue on the wrong node version(14.5.0).

I switched to the correct version(12.18.3) so it worked.

0
votes

Inside package.json convert node-sass version to :

"node-sass": "^4.0.0"
0
votes

I installed the latest version which at the moment of writing this comment is 5.0.0

npm install node-sass@latest

0
votes

None of above solutions worked as I faced error while rebuilding the node-sass with npm rebuild node-sass or reinstall or uninstall/install.

The solution was to upgrade GCC (g++) version to the latests 7.3.1 instead of my previously installed 4.8.5.

Older 4.8.5 didn't support command line option '-std=c++14' which is used while compiling node-sass on installation.

So just upgrade gcc and then use any solution with node rebuild node-sass or any other mentioned above.

0
votes

I upgraded npm from 6.4.12 to 7.14.0, this error went away. And then I got another error

Error: Node Sass version 5.0.0 is incompatible with ^4.0.0.

I searched for a solution and found it here. I uninstalled node sass 5.0.0 and installed 4.14.1 (apparently this is the latest 4 version of node sass, verified with npm view node-sass versions command).

This gave me a truck load of errors. npm install node-sass@

4.14.1npm ERR! code 1
npm ERR! path /home/<subfolder>/commonreact/node_modules/node-sass
npm ERR! command failed
npm ERR! command sh -c node scripts/build.js
.. 2000 lines of Err ..
npm ERR! gyp ERR! cwd /home/<subfolder>/commonreact/node_modules/node-sass
npm ERR! gyp ERR! node -v v16.2.0
npm ERR! gyp ERR! node-gyp -v v3.8.0
npm ERR! gyp ERR! not ok 
npm ERR! Build failed with error code: 1

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/<username>/.npm/_logs/2021-05-25T13_09_09_655Z-debug.log

I then tried npm audit fix --force

I get this error

npm WARN audit No fix available for cp-cli@*
npm ERR! code ETARGET
npm ERR! notarget No matching version found for [email protected].
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.

I checked my package.json it had "object-path": "0.11.4",

Then I tried npm install [email protected]

Basically stuck in hell with this issue on Ubuntu 20.04. Should have never upgraded to Ubuntu 20.04.

I will keep trying and report my finding here. I am confident of solving this issue.

Edit I downgraded npm from 7.14.0 to 6.14.12, npm start now reports Error: Node Sass version 6.0.0 is incompatible with ^4.0.0. I checked npm node_sass -v reported 6.14.12. I ran npm uninstall node-sass, and npm install [email protected].

binding.target.mk:133: recipe for target 'Release/obj.target/binding/src/binding.o' failed
make: *** [Release/obj.target/binding/src/binding.o] Error 1
make: Leaving directory '/home/<subfolder>/commonreact/node_modules/node-sass/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/home/<subfolder>/commonreact/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (node:events:365:28)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
gyp ERR! System Linux 4.15.0-143-generic
gyp ERR! command "/home/<subfolder>/.nvm/versions/node/v16.2.0/bin/node" "/home/<subfolder>/commonreact/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /home/<subfolder>/commonreact/node_modules/node-sass
gyp ERR! node -v v16.2.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 
Build failed with error code: 1
npm WARN @babel/[email protected] requires a peer of @babel/core@^7.13.0 but none is installed. You must install peer dependencies yourself.
npm WARN @babel/[email protected] requires a peer of @babel/core@^7.12.0 but none is installed. You must install peer dependencies yourself.
npm WARN @material-ui/[email protected] requires a peer of @date-io/core@^1.3.6 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of [email protected] - 3 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/jest-haste-map/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/watchpack/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Edit Works Now I followed the steps here, and

node -v -> 16.something

nvm install lts/erbium -> sets node to 12.22.1

npm uninstall node-sass

npm install [email protected]

AND IT WORKED

0
votes

I solved this problem by installing newest version of python 2.7.x and then adding the path to the folder containing python.exe file to the environment variables. For me, the path was "C:\python27" And then run the start command it will work.

The problem is clearly visible because gulp is using python 3.x version when clearly it shows that it is using python 2.7 syntax to execute.

import sys; print "%s.%s.%s" % sys.version_info[:3];
0
votes

The best solution here is to move to dart-sass because of the deprecated status of node-sass library.

-1
votes

Commands npm uninstall node-sass && npm install node-sass didn't help me, but after installing Python 2.7 and Visual C++ Build Tools I deleted node_modules folder, opened CMD from Administrator and ran npm install --msvs_version=2015. And it installed successfully!

This comment and this link can help too.