当我尝试使用 npx create-react-app example_app
创建一个新的 React 应用程序时,我收到此错误
[Your cache folder contains root-owned files, due to a bug in previous versions of npm which has since been addressed sudo chown -R 0:0 "/root/.npm"]
我什至尝试重新安装create-react-app
再次使用npm i create-react-app
,它给出了同样的类型
error .
搜索后我认为这是由于某些权限问题造成的。我当前的用户没有 /home/shubham/.npm
的权限哪里shubham
是我的用户名,但我对此不太确定。
我尝试使用 chown
解决此错误命令为
sudo chown -R <username>:<groupname> /home/shubham/.npm"
哪里<username>
是 Shubham
和<groupame>
是 1000
,但仍然无法正常工作。
请求人们帮助我。 如果您需要更多信息,请告诉我。
最佳答案
这对我有用:
sudo npm cache clean --force
关于javascript - 错误 "Your cache folder contains root-owned files, due to a bug in previous versions of npm"而 "npx create-react-app example_app",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59437833/