![](/img/trans.png)
[英]Error "Your cache folder contains root-owned files, due to a bug in npm ERR! previous versions of npm which has since been addressed"
[英]npm install always gives 'Your cache folder contains root-owned files, due to a bug in npm previous versions of npm which has since been addressed.'
我目前正在使用 Ubuntu 18.04.4 并且我正在尝试使用npm install
安装一些东西,但它总是给出以下错误。 我也尝试了其他别名( npm i
, npm add
),但错误仍然存在。
npm install
npm ERR! code EPERM
npm ERR! syscall open
npm ERR! path /home/dell/.npm/_cacache/content-v2/sha512/14/21/2143fe2b135cd8bfdad85c9c3f9ac46ab279a58dee631cfea1b9678167bd388d44f2d36739019c96ba3a4c4756b1ea6570f4dc8931fb8ad8230359521f80
npm ERR! errno -1
npm ERR!
npm ERR! Your cache folder contains root-owned files, due to a bug in
npm ERR! previous versions of npm which has since been addressed.
npm ERR!
npm ERR! To permanently fix this problem, please run:
npm ERR! sudo chown -R 1001:1001 "/home/dell/.npm"
npm ERR! A complete log of this run can be found in:
npm ERR! /home/dell/.npm/_logs/2020-07-30T17_16_58_257Z-debug.log
当我运行sudo chown -R 1001:1001 "/home/dell/.npm"
命令时,它什么也不做,当我再次运行npm install
时,错误仍然存在。 我也搜索了 StackOverflow 和其他平台的答案,但似乎没有解决方案可以解决这个问题。
PS:我的节点版本是12.18.3,npm版本是6.14.6。
如果有人可以帮助我解决这个问题,我将不胜感激!
我对 create-react-app 有问题。 使用纱线解决它。
yarn global remove create-react-app
然后
yarn global add create-react-app
和
create-react-app MyApp
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.