So, I had used sass before using npm install node-sass
for my reactjs project. I'm now working on a new project and wanted to use sass again. With the same syntax npm install node-sass
to get it installed, I continued to get
./src/components/Main.scss (./node_modules/css-loader??ref--6-oneOf-5-1!./node_modules/postcss-loader/src??postcss!./node_modules/react-scripts/node_modules/sass-loader/lib/loader.js??ref--6-oneOf-5-3!./src/components/Main.scss)
Error: Node Sass version 8.0.0 is incompatible with ^4.0.0.
Or
to import sass files, you first need to install node-sass. run `npm install node-sass` or `yarn add node-sass` inside your workspace
...
...
I followed the instructions to have sass installed from the links npmjs sass-lang using these syntaxes
brew install sass/sass/sass
npm install -g sass
but I'm still encountering either errors I mentioned earlier.
I tried deleting the node-module folder, package-lock.json and reinstalled node-modules. That still did not fix the error. Also, I followed how others got around fixing Node Sass version 5.0.0||6.0.0|| 7.0.0 incompatibility issue but that did not fix mine.
I'm seeking help now.
node-sass
anymorenode-sass
is now deprecated. You can easily fix it by the following.
npm uninstall node-sass
npm install sass
It works fully the same with better stability, You will not need to make any additional changes.
And all Works well !
node-sass
You can use the following table to install the appropriate version node-sass
for your installed Node.js version which you can check by the command node --version
.
npm install node-sass@(your version)
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