npm cache clean --force 报错解决方法
执行 npm cache clean --force 命令遇到如下报错信息:
$ npm cache clean --force
npm WARN using --force I sure hope you know what you are doing.
npm ERR! code EACCES
npm ERR! syscall unlink
npm ERR! path /Users/teng/.npm/_cacache/index-v5/10/a5/91097af49aef49439e613e418c5be2707991a587cbf40e932a437e05d181
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/teng/.npm"
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/teng/.npm/_logs/2022-01-20T06_17_48_414Z-debug.log