简体   繁体   中英

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

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. 在此处输入图片说明

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 !!

I ran into this issue and saw this: 在此处输入图片说明

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM