Abraham
Abraham

Reputation: 15640

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

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

Upvotes: 4

Views: 10073

Answers (3)

Abraham
Abraham

Reputation: 15640

Install sass instead

The library node-sass is now deprecated. So you can use the new version sass

Do the following

npm uninstall node-sass
npm install sass

Works with no further changes

Upvotes: 4

Mr. Programmer
Mr. Programmer

Reputation: 3103

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:
[email protected]
[email protected]

My solution that works: I just install the following modules:
npm install -D [email protected]
npm install -D [email protected]

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

Upvotes: 4

Mereb Hayl
Mereb Hayl

Reputation: 58

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 [email protected]

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 [email protected]



Or to avoid the error for all versions

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

Upvotes: 0

Related Questions