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 files, due to a bug in previous versions of npm which has since been addressed sudo chown -R 0:0 "/root/.npm"]
I even tried to re-install create-react-app
again using npm i create-react-app
, it is giving the same kind of
error.
I assume after searching about it that it is due to some permissions issue. My current user doesn't have permission to /home/shubham/.npm
where shubham
is my username, but I am not so sure about this.
I have tried to solve this error using chown
command as
sudo chown -R <username>:<groupname> /home/shubham/.npm"
where <username>
is Shubham
and <groupame>
is 1000
, but it is still not working.
Request people to help me out. If you need any more information, let me know.