Error "Your cache folder contains root-owned files, due to a bug in npm ERR! previous versions of npm which has since been addressed"

Viewed 1643

I recently installed Ubuntu 18.04 Stable version. I installed latest stable version of Node.js (v12.16.1) and npm (v6.13.4).

When i was trying to install "create-react-app" using "npm i create-react-app", I am getting error. enter image description here

Your cache folder contains root-owned files, due to a bug in previous versions of npm which has since been addressed

I have tried sudo chown -R 1000:1000 "/home/shubham/.npm", but still getting same error.

Request people to help me out.

Thanks in advance !!

1 Answers

I ran into this issue and saw this:enter image description here

One of my issues was that /npm did not exist. I created /npm and and then ran the suggested command sudo chown -R 1000:1000 "/npm" and it seemed to work. I also ran into the same issue with ~/.npm - I believe the difference is that one is global and the other is local.

Related