386
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)
Roland Weisleder
  • 9,668
  • 7
  • 37
  • 59
Premkumar Agrawal
  • 4,116
  • 2
  • 13
  • 14
  • 52
    run `npm rebuild node-sass` or `sudo npm rebuild node-sass` – youhans Jul 22 '17 at 14:40
  • Check it https://stackoverflow.com/questions/37324519/node-sass-does-not-yet-support-your-current-environment-linux-64-bit-with-false/48297824#48297824 – Andrei Todorut Jan 17 '18 at 09:39
  • After node update on ubuntu, i had the same problem. `yarn` (`yarn install`) automatically rebuild node-sass and solved the problem. – Leto Mar 31 '23 at 09:40

39 Answers39

532

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.

Peyman Mohamadpour
  • 17,954
  • 24
  • 89
  • 100
Quinn Comendant
  • 9,686
  • 2
  • 32
  • 35
  • 13
    deleted `node_modules` and performed `yarn install` which rebuilt the `node-sass` (and other libs) with the new version of the node. Thanks. – oyalhi May 16 '19 at 15:40
  • 9
    you can npm uninstall node-sass && npm install node-sass, this worked for me – Sagar M Jun 07 '19 at 07:02
  • 5
    Use `npm un node-sass && npm i node-sass -D` if you have `node-sass` in your *devDependencies*. – A1rPun Dec 09 '19 at 19:01
  • @oyalhi worked for me but only after I also removed the yarn.lock file – jnaklaas Jul 17 '20 at 10:10
  • I tried "npm rebuild node-sass", then "npm uninstall node-sass && npm install node-sass" still didnt work. After installing it globally "npm install node-sass -g" it worked – techloris_109 Mar 08 '21 at 12:16
  • worked for me, rolled back to v14 LTS from v16 job done :) – royG Jun 08 '21 at 14:38
  • The first rebuild option gives me errors. The second option - uninstall and reinstall node-sass works for me. – Noobie3001 Feb 12 '22 at 13:22
132

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

Pullat Junaid
  • 3,224
  • 3
  • 25
  • 25
  • 2
    Works great for me thanks! Side not this showed up on an old angular 5 project one I updated the angular cli. (not sure why) If you hate node-sass say AYYY – ItaiRoded Jan 30 '20 at 00:53
  • 5
    Uninstalling and reinstalling fixes the problem. However, while installing you may need to specify the version being installed. e.g ```npm install node-sass@4.14.1``` which installs the latest version before 5.0 to avoid the error ```Error: Node Sass version 5.0.0 is incompatible with ^4.0.0``` – Onen simon Jan 11 '21 at 11:45
  • If you use yarn then these would be the appropriate commands: `yarn remove node-sass` && `yarn add node-sass` – Lehtis Mar 16 '22 at 07:42
  • Before doing that I also had to install all prerequisites on Windows (Python, Visual C++ Build Environment, etc.): https://github.com/nodejs/node-gyp#on-windows – Benny Code Aug 12 '22 at 15:07
33

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

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

Enayat
  • 3,904
  • 1
  • 33
  • 47
  • 1
    Run `npm config set msvs_version 2015 --global` after installing Visual Studio Build Tools and before running `npm install` or `npm rebuild node-sass`. [See here for more details.](https://github.com/nodejs/node-gyp/issues/307#issuecomment-364210877) – ADTC Feb 08 '18 at 19:28
  • 1
    I also had to run npm audit fix in order to get everything working – Myzifer Aug 22 '19 at 09:03
  • 1
    @ADTC - Thanks! the npm config setting worked the magic for me (I've installed VS2019 since I last compiled this project). – Ade Oct 20 '20 at 07:23
24

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
curiousBoy
  • 6,334
  • 5
  • 48
  • 56
21

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 node-sass@4.14.1, 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 node-sass@4.14.1 (reinstall node-sass)
  4. npm rebuild node-sass
  5. npm start
Royalty
  • 463
  • 1
  • 4
  • 10
20

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.

Руслан
  • 675
  • 7
  • 8
15

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

npm uninstall node-sass
npm install node-sass@4.14.1

Source: here

Gopala Raja Naika
  • 2,321
  • 23
  • 18
11

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.

Avjol Sakaj
  • 1,281
  • 10
  • 14
9

If you have an old project built with node 8 you have to run under node 8:

$npm rebuild node-sass

then switch to node 10 or higher and run:

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

after these actions everything works fine for me. If I do it under node 8 or node 10 and higher, it does not fix the issue in the project. Could be it will help someone :)

SergioZhydecky
  • 136
  • 1
  • 2
7

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

Nipun Tharuksha
  • 2,496
  • 4
  • 17
  • 40
7

The below code worked for me. Try using this in terminal

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

You can add -g to it if you want to install it globally

Haris George
  • 291
  • 5
  • 16
6

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

nscalf
  • 528
  • 5
  • 10
5

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
solimanware
  • 2,952
  • 4
  • 20
  • 40
5

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
jizhihaoSAMA
  • 12,336
  • 9
  • 27
  • 49
JCM
  • 51
  • 1
  • 1
4

Try this:

npm --depth 9999 update
npm rebuild node-sass
Fernando Nogueira
  • 1,302
  • 1
  • 14
  • 22
4

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

amdg
  • 2,211
  • 1
  • 14
  • 25
4

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 node-sass@4.14.1

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

Dharman
  • 30,962
  • 25
  • 85
  • 135
4

The below code worked for me.

npm uninstall node-sass --legacy-peer-deps
npm install node-sass --legacy-peer-deps
Sumant Singh
  • 904
  • 1
  • 14
  • 16
3

If you use NVM, VS Code and the VS Code Task Explorer to run npm scripts that use node-sass, the below caveat should save you some hours of head-banging.

I was using VS Code's Task Explorer to run my scripts and have installed multiple Node versions using NVM, defaulting to the current latest version 16. When I opened my VS Code repository and ran nvm use 10 in a new terminal, the Node and npm version in that terminal window correctly downgrades, but the version of node/npm used by the Task Explorer runner remained at Node 16. So when running my webpack script using the VS Code Task Runner, node-sass would still throw the environment error of this question.

Solution is to either not use the VS Code Task Runner and run your script in the terminal where you changed your node version or change the default NVM Node version using the below command, restart VS Code and then use the Task Explorer / Runner.

nvm alias default 10 (or whatever version you need for node-sass compatibility)

jimmymadon
  • 602
  • 6
  • 9
  • I was looking for this kind of answer, although the bit I'm currently interested in should be a solution for VS2022 to prioritize the correct node version, regardless NVM was installed. I believe it's somewhere in "Tools > Options > Projects and Solutions > Web Package Management > External Web Tools" – Tim Vermaelen Feb 08 '23 at 13:07
2

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.

Zsolt Meszaros
  • 21,961
  • 19
  • 54
  • 57
  • This is the solution for my macOs. I checked the tags until I fond the one what supports my OS version. I just had to replace it into package.json, remove node_modules and run yarn. – Jorj Jul 26 '21 at 13:39
2

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

Husain Ali
  • 155
  • 1
  • 9
2

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

npm install node-sass@latest

Dragos Lupei
  • 592
  • 4
  • 10
1

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 :)

Tarun Kumar
  • 498
  • 5
  • 16
1

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.

Mike
  • 378
  • 1
  • 8
1

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 object-path@1.1.5.
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 node-sass@4.0.0

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 node-sass@4.14.1.

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/plugin-bugfix-v8-spread-parameters-in-optional-chaining@7.13.12 requires a peer of @babel/core@^7.13.0 but none is installed. You must install peer dependencies yourself.
npm WARN @babel/plugin-proposal-class-static-block@7.14.3 requires a peer of @babel/core@^7.12.0 but none is installed. You must install peer dependencies yourself.
npm WARN @material-ui/pickers@3.2.10 requires a peer of @date-io/core@^1.3.6 but none is installed. You must install peer dependencies yourself.
npm WARN bootstrap@4.5.0 requires a peer of jquery@1.9.1 - 3 but none is installed. You must install peer dependencies yourself.
npm WARN tsutils@3.21.0 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: fsevents@1.2.13 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.0.7 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.0.7: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/jest-haste-map/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.3.2 (node_modules/watchpack/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@4.14.1 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the node-sass@4.14.1 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 node-sass@4.14.0

AND IT WORKED

Siddharth
  • 9,349
  • 16
  • 86
  • 148
  • That's cool. But if you want to keep your version of node while trying to fix your node-sass issue, then you have to simply open your package.js file, then remove the node-sass dependency and just reinstall node-sass with **npm uninstall node-sass** and then it will install the version that is compatible with your current node version. – vially Nov 29 '21 at 12:26
1

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

Kiryl Plyashkevich
  • 2,157
  • 19
  • 18
1

Try to install lower version of node if you have no other way.

find available node version

brew search node

install lower version like 12

brew install node@12

unlink existing version

brew unlink node

using new version

brew link node@12

if you got warning like "Warning: node@12 is keg-only and must be linked with --force"

brew link --force --overwrite node@10 echo 'export

update and source your config

PATH="/usr/local/opt/node@12/bin:$PATH"' >> ~/.bash_profile source ~/.bash_profile

zhao
  • 1,094
  • 9
  • 9
1

Answer from 2022. My project is using node-sass version 4.14.1. Had to downgrade my node to version 12.16.1 with the command:

npm install node@12.16.1

This fixed the issue and allows me to use webpack again.

minTwin
  • 1,181
  • 2
  • 21
  • 35
1

You need to downgrade node to 14 version:

npm install -g n
n 14
# if one of the commands does not pass, you may need to use sudo
sudo npm install -g n
sudo n 14
Hekmat
  • 153
  • 5
1

When using the Task Runner Explorer from Visual Studio make sure you prioritise the right PATH.

Also make sure, once you change the priority, to restart VS.

  • $(PATH) points to the default node path
  • .\node_modules\.bin points to the Visual Studio path

enter image description here

So when you use NVM to switch node versions, you should opt for the System Path.

Tim Vermaelen
  • 6,869
  • 1
  • 25
  • 39
0

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.

Remy Wang
  • 666
  • 6
  • 26
0

Inside package.json convert node-sass version to :

"node-sass": "^4.0.0"
0

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];
Krishna Sai
  • 181
  • 1
  • 1
  • 11
0

Updating you sass-loader should do the magic.

npm i sass-loader@latest
0

Using Nodist - node version manager

If you work with nodist version manager, and you only set a local (folder) node version, you might get this error.

To solve it, you need to set the global node version to the version that match node-sass version.

Shay Vaturi
  • 89
  • 1
  • 6
0

In my case I was supposed to be using sass instead of node-sass which can be corrected by running the following in the terminal:

npm uninstall node-sass
npm i sass
npm start
Ahmedakhtar11
  • 1,076
  • 11
  • 7
0

I recently had a similar issue when the node version for the project I was working on was bumped from 8 to 12. I switched to node 12 using the nvm use 12.20.1 command, but when I ran the app with npm start, I encountered an error.

Running npm install fixed the issue. This is because npm install downloads and installs all of the dependencies for the project, including the node modules that were missing or outdated.

I hope this helps!

-1

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.

-1

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

Lawrence Eagles
  • 697
  • 9
  • 8