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 2460
灰色年华
灰色年华 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:42

    I also tried all of the above steps on my MAC Catalina, but didn't resolve my issue. These steps resolved my problem:

    npm update
    npx --ignore-existing create-react-app my-app
    

    Thanks to this comment

    0 讨论(0)
  • 2021-02-12 22:44

    Try sudo npx create-react-app example_app or in my case sudo npm install @vue/cli

    I tried everything else here, but in the end realised that it might just be the command that I was running was not able to escalate the correct permissions.

    0 讨论(0)
  • 2021-02-12 22:46

    It helped me: Remove and install npm again

    0 讨论(0)
提交回复
热议问题