Error “Your cache folder contains root-owned files, due to a bug in previous versions of npm” while “npx create-react-app example_app”

前端 未结 9 2436
灰色年华
灰色年华 2021-02-12 21:48

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

9条回答
  •  太阳男子
    2021-02-12 22:25

    It work for me now!

    What I did? (I'm not saying it's the best way to fix this but i'ts working for me. I'm still looking for the best explications for this issue)

      sudo rm -Rf /home/[YOUR_USER_NAME]/.npm-global/lib/node_modules/
    

    and run your command again.

    My explication is that it seems like something is corrupted in the node_modules's folder. As it's not risky to delete it I did it and it works now.

提交回复
热议问题