I installed the latest version of node-sass in my react app but I got this error
"./src/index.scss (./node_modules/css-loader/dist/cjs.js??ref--5-oneOf-6-1!./node_modules/postcss-loader/src??postcss!./node_modules/resolve-url-loader??ref--5-oneOf-6-3!./node_modules/sass-loader/dist/cjs.js??ref--5-oneOf-6-4!./src/index.scss)
Node Sass version 6.0.1 is incompatible with ^4.0.0 || ^5.0.0."
My Json file :
{
"name": "new-project-to",
"version": "0.1.0",
"private": true,
"dependencies": {
"cra-template": "1.1.2",
"node-sass": "^6.0.1",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-scripts": "4.0.3"
},
I've checked some solutions on StackOverflow like npm install [email protected] but it didn't work?
What do you think guys?
Another approach to fix the “Node Sass does not yet support your current environment” error would be to downgrade your Node back to the version it was when node-sass worked. You could use the nvm use [node version] command to achieve this.
The “-v” command checks the version of SASS you have installed. If you don't have it installed, it will come back as not installed.
To make node-sass available in your source code, npm needs to build the package and create a binding for your environment. When you change the version of Node. js used on your project, then the binding needs to be rebuild so that node-sass can be imported and executed from your code.
Can you try editing the package.json to read
"dependencies": {
"node-sass": "^5.0.0",
...
},
...
and then run npm i
Hope that helps, but it may not if Armuth's solution didn't work...
Update your sass-loader like this: npm i sass-loader@latest
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With