Reputation: 15640
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
What is the problem?
Upvotes: 4
Views: 10073
Reputation: 15640
sass
insteadThe 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
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
Reputation: 58
The following errors occur only when there is a version mismatch. with node-sass
and installed node.js
npm install [email protected]
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