ubuntu下npm全局安装包报错的解决方案

大概就是

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"

之前一直没管直接就sudo完事,突然发现只要chown -R ${USER} 把对应目录的权限加上就好了

全部评论

相关推荐

02-24 10:34
门头沟学院 Java
已注销:之前发最美的女孩基本爱答不理,发最帅的hr终于有反馈了,女孩子也要自信起来
点赞 评论 收藏
分享
03-16 22:00
武汉大学 C++
幸福的小熊猫想要offer:我阿里投的 c++岗,面试官说自己是做 java 的,c++这辈子才有了
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务