Prageeth Milan
Prageeth Milan

Reputation: 53

Error: Node Sass version 8.0.0 is incompatible with ^4.0.0

When I start a React app with npm start, I got this error.How I fixed this error?

./src/App.scss (./node_modules/css-loader/dist/cjs.js??ref--6-oneOf-5-1!./node_modules/postcss-loader/src??postcss!./node_modules/resolve-url-loader??ref--6-oneOf-5
-3!./node_modules/react-scripts/node_modules/sass-loader/dist/cjs.js??ref--6-oneOf-5-4!./src/App.scss)
Error: Node Sass version 8.0.0 is incompatible with ^4.0.0.

Here is the screenshot of error

Upvotes: 1

Views: 7212

Answers (3)

heysujal
heysujal

Reputation: 138

I had the similar error in one of my angular projects and I did try npm uninstall node-sass and npm install sass but it was giving the same error.

So, this process below worked for me (in Windows)

  1. Go to C:\Users\FakeUser
  2. Find node_modules folder and delete it
  3. Also delete the node_modules folder present in your project directory
  4. Now do npm install in project directory to generate fresh node_modules

Upvotes: 0

Abraham
Abraham

Reputation: 15640

Don't use node-sass anymore

The module node-sass is now deprecated and replaced with a more robust new version which is sass. Only change the module and all would work fine. You can uninstall the old one and install the new one:

npm uninstall node-sass
npm install sass

And all Works same !



For those who want to use node-sass anyways

To avoid the error, you can use the following table to install the appropriate version node-sass for your installed Node.js version which you can check by the command node --version.

npm install node-sass@(your version)

enter image description here

Upvotes: 5

Saidamir
Saidamir

Reputation: 326

  1. npm uninstall node-sass
  2. npm install sass

Upvotes: 1

Related Questions