0

Hello everyone I just added sass in all possible ways to my app by npm install sass by npm install node-sass by yarn add sass-loader even by sudo npm install --save-dev --unsafe-perm node-sass all these commands by yarn also and my app tells me to add sass :/ Packages.json

App.js

Error

8
  • "sudo npm install --save-dev --unsafe-perm node-sass" - you really shouldn't do that - a malicious npm package could destroy your entire system or plant a kernel-mode rootkit/spyware program. Commented Jul 5, 2020 at 8:29
  • I read it in stackoverflow's other threads :/ but it didn't work also so... Commented Jul 5, 2020 at 8:30
  • Did you install node-sass globally? If no install it npm install -g node-sass globally Commented Jul 5, 2020 at 8:31
  • I'm sure I did because I did all possible variations of node-sass and sass Commented Jul 5, 2020 at 8:34
  • Can you stop the server and delete the node_modules and re-run npm install or yarn, whichever you use? Commented Jul 5, 2020 at 8:35

2 Answers 2

1

Oh I finally did it, I don't know for sure but I guess when installing a new thing node sass or anything you should re-run the react app refresh or even ctrl+f5 won't work I have right now 2 tabs of my react app one is http://localhost:3000/ the other one http://localhost:3001 I commanded yarn start again after installing and it work while the first one is still open and it doesn't work

Hope this will help others

Sign up to request clarification or add additional context in comments.

Comments

0

Below is the documented process for adding sass to react app using yarn

yarn add node-sass

Rename the .css files to .scss and update the import statements.

I just did it on my machine and it works.

8 Comments

Yeah I did it look at my images everything is done as you told, still doesn't work :/
According to your screenshots, You have a blank app, please generate new app and then run ` yarn add node-sass`
I don't understand :/
1. Generate a new app by npx create-react-app my-app 2. Run yarn add node-sass 3. Change the filenames and imports. Hope it should work
Why should I create a new app I did a lot of work in this one :/
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.