npm inatsll时报错如下
npm ERR! code EACCES
npm ERR! syscall open
npm ERR! path /Users/xxxx/.npm/_cacache/index-v5/c6/06/xxxxxxx
npm ERR! errno -13
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 501:20 "/Users/xxxxxx/.npm"npm ERR! A complete log of this run can be found in:
npm ERR! /Users/xxxxx/.npm/_logs/2022-08-15T08_51_19_180Z-debug.log
遇到以上情况只需要按照他的提示执行
sudo chown -R 501:20 "/Users/xxxxxx/.npm"
这段代码,问题即可解决
注意:完全复制下来执行,我在执行过程中的时候去掉引号就进入dquote模式下,这样并不能解决什么~