You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Installing node-sass as recommended in the documentation to have SASS support returns following error on compilation:
Error: Node Sass version 5.0.0 is incompatible with ^4.0.0
sass-loader was updated to v10.0.5 for supporting node-sass v5.0.0 (webpack/sass-loader#899), but react-scripts is pinned to sass-loader 8.0.0. This means that every fresh installation (or update) which is using node-sass will end up with this error on yarn/npm start.
Modify App.css to App.scss. Change extension in App.js as well.
yarn start
Expected behavior
Scss files compiled to css without sass-loader returning an error.
Actual behavior
Failed to compile.
./src/App.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/App.scss)
Error: Node Sass version 5.0.0 is incompatible with ^4.0.0.
It might be a good time to move to sass (dart implementation) instead of libsass/node-sass.
Further to the above, also note that node-sass has been deprecated.
I followed this suggestion and simply replaced node-sass with sass and everything seems to be working fine without any other changes required.
npm uninstall node-sass
npm i sass
Reacted by Patrik Spathon, David, Christoph Wanja, meysam213, Johannes Kortmann, Michail Chatzizacharias, Marius, Léo Mieulet, Leon, Naomi Schoppa and 68 more
Reacted by Paul Kim, Joaquin van Loon, Yaroslav Admin, Dakshina Udayanga, AbyResearchers, dmytro, Andrés Londoño, Thiago Crespo, Selvesan, Нагима Кенеуова and 5 more
Reacted by Paul Kim, Martin Grund, Joaquin van Loon, Dakshina Udayanga, AbyResearchers, Andrés Londoño, Thiago Crespo, Jailson Pacagnan Santana, Selvesan, Нагима Кенеуова and 3 more
Reacted by Nathan Hannig, Biplap Bhattarai, Paul Kim, Íñigo Marquínez Prado, Alvaro Fernandez, Victor Ribeiro, Martin Grund, Joaquin van Loon, Dakshina Udayanga, AbyResearchers and 11 more
Reacted by Ante, Marius, Nathan Hannig, Biplap Bhattarai, Paul Kim, Alvaro Fernandez, Joaquin van Loon, Eric Rabiner, Shelby McCowan, Dakshina Udayanga and 8 more
Activity
nhevia commentedon Nov 2, 2020
It might be a good time to move to sass (dart implementation) instead of libsass/node-sass.
cduff commentedon Nov 12, 2020
Further to the above, also note that node-sass has been deprecated.
I followed this suggestion and simply replaced
node-sasswithsassand everything seems to be working fine without any other changes required.iamkennis commentedon Nov 12, 2020
how i resolve this issues :
Powersource commentedon Nov 13, 2020
Does this essentially mean that CRA doesn't support node 15?
nhevia commentedon Nov 25, 2020
Be careful with that approach #10045
Switch from node-sass to sass
errorsolve commentedon Dec 9, 2020
This Error Solved By All Possible Solution In This Article At Here Error: Node Sass version 5.0.0 is incompatible with ^4.0.0
sunvodz commentedon Oct 15, 2021
Install node-sass: yarn add node-sass
Convert your .css files to .scss
Convert your import file.scss
if not work
1.yarn remove node-sass
2.yarn add node-sass@4.14.1
piyas33 commentedon May 29, 2022
Type the following command:
npm rebuild node-sassI hope its works.
SeyfCHERNI commentedon Mar 15, 2023
npm add node-sass --force works good :D 😃