When I was trying to create a new react app using npx create-react-app example_app
, I get this error
[Your cache folder contains root-owned
I had the same issue and several others while trying to update my npm packages. I will be honest I do not have enough knowledge of package handlers or why this fixed my situation, but I believe my version of npm and npx were causing the issues. I had errors immediately trying to install npx, node and create-react-app with my old and out of date version of npm.
I could not run npm install npx -g
without --force
. Once I did that I also ran npm install npm -g --force
. After this I could already tell things were different.
After npm and npx were completely overwritten, I ran npm install node -g
and npm install create-react-app -g
without any weird problems. I created a new react app and started it error free.
(I also ran the cache command before all of this. sudo npm cache clean --force
which I am unsure if it helped).