![](/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.