Can't install sass-loader in React project to use SCSS

Hello!

I was able to use SCSS in my React project but for some reason I’ve now get errors when trying to start the project.

The error I get when I run npm start is
To import Sass files, you first need to install node-sass. Run npm install node-sassoryarn add node-sass inside your workspace.

So I tried to do npm install node-sass and I get this really long error

Sorry for the image…Github gave me an error trying to copy and paste the code…

I have reinstalled Xcode command line tools. Installed node-gyp globally. Checked my Python is working (v 2.7.16). I even reinstalled node (v 15.0.1) and check npm (v 6.14.8). I have deleted my package-lock.json file and node-modules and reinstalled everything. I don’t know what else to do. Any help would be appreciated.

Thank you!

Hi rkatz235,

I fought for hours yesterday with the same error. The reason for the error was a too recent node version (15.0.1).I uninstalled Node completely and then with brew install node@12 downgraded to version 12 (13 and 14 I couldn’t load) and then npm rebuild node-sass. Now everything works again. :slight_smile: Maybe it will solve your problem.

Thank you so much! I skipped the uninstalling Node part and just brew install n and downgraded to node12. Then I reinstalled node-sass in the project folder and it worked! Thank you. Everything works now - although my React inline requires for images src={require(".../file/path/image.png")} don’t work anymore but worse things can happen.

1 Like