ubuntuでのnpmグローバルインストールパッケージエラーの解決策

760 ワード

たぶん
npm WARN registry Unexpected warning for https://registry.npmjs.org/: Miscellaneous Warning ERR_STREAM_DESTROYED: Cannot call write after a stream was destroyed
npm WARN registry Using stale data from https://registry.npmjs.org/ due to a request error during revalidation.
npm ERR! code EACCES
npm ERR! syscall open
npm ERR! path /home/keane/.npm/_cacache/tmp/0a654d27
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 1000:1000 "/home/keane/.npm"

これまでずっとスドについていなかったのですが、いきなりchown-R${USER}で対応ディレクトリの権限を付けておけばよかったのです