3

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
    Does this answer your question? [Error "Your cache folder contains root-owned files, due to a bug in previous versions of npm" while "npx create-react-app example\_app"](https://stackoverflow.com/questions/59437833/error-your-cache-folder-contains-root-owned-files-due-to-a-bug-in-previous-ver) – Anurag Srivastava May 12 '20 at 13:56
  • The link above has no accepted answers – George S Jun 09 '20 at 21:46

1 Answers1

0

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.

Ben Creasy
  • 3,825
  • 4
  • 40
  • 50