Node Sass version 7.0.0 is incompatible with ^4.0.0 || ^5.0.0 || ^6.0.0

Viewed 7308

I have a react project I created using create-react-app And I was trying to use sass in react by installing node-sass for react.js

But I keep getting an error saying It's incompatible.

Node Sass version 7.0.0 is incompatible with ^4.0.0 || ^5.0.0 || ^6.0.0

Node Sass version 7.0.0 is incompatible with ^4.0.0 || ^5.0.0 || ^6.0.0

What is the problem?

Error: 'node-sass' version 5.0.0 is incompatible with ^4.0.0 Node Sass version 7.0.0 is incompatible with ^4.0.0 || ^5.0.0 || ^6.0.0 Node Sass version 6.0.0 is incompatible with ^4.0.0 || ^5.0.0 in React.js
3 Answers

I've also encountered this problem in my nodejs project.
The error says "Error: Node Sass version 7.0.1 is incompatible with ^4.0.0.""

Here's my current node & npm version:
npm version: 8.1.2
node version: v16.13.1

And my current node-sass & sass-loader:
sass-loader@7.1.0
node-sass@7.0.1

My solution that works: I just install the following modules:
npm install -D sass-loader@10.2.0
npm install -D node-sass@6.0.1

Other references:
https://github.com/webpack-contrib/sass-loader/issues/945#issuecomment-836976664

The following errors occur only when there is a version mismatch. with node-sass and installed node.js

Node Sass version 7.0.0 is incompatible with ^4.0.0 || ^5.0.0 || ^6.0.0

  • For this error, you can remove your node-sass and install node-sass version 6 using npm install node-sass@6.0

Node Sass version 6.0.0 is incompatible with ^4.0.0 || ^5.0.0 in React.js

  • When you installed node sass 6.0 on node.js of version 14, you get the following error. you can fix it by installing npm install node-sass@4.14.1



Or to avoid the error for all versions

You can use sass instead of node-sass or install the right node sass version

Related