在npm上安装:未处理的拒绝错误:EACCES:权限被拒绝 [英] On npm install: Unhandled rejection Error: EACCES: permission denied

查看:211
本文介绍了在npm上安装:未处理的拒绝错误:EACCES:权限被拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我设法破坏了npm安装,并且每当尝试使用npm install安装软件包时,都会收到以下错误消息:

I have managed to corrupt my npm install, and whenever I try to install packages using npm install, I receive error messages along these lines:

未处理的拒绝错误:EACCES:权限被拒绝,打开'/Users/marknorgate/.npm/_cacache/tmp/a449402d'

Unhandled rejection Error: EACCES: permission denied, open '/Users/marknorgate/.npm/_cacache/tmp/a449402d'

我尝试重新安装节点& npm,我还尝试使用这些说明但没有任何效果.

I have tried reinstalling node & npm, and I have also tried to relocate my npm cache elsewhere using these instructions but nothing works.

我如何使其正常工作?

推荐答案

将用户与npm相关的文件夹的所有权还原到当前用户,就像这样:

Restore ownership of the user's npm related folders, to the current user, like this:

sudo chown -R $USER:$GROUP ~/.npm
sudo chown -R $USER:$GROUP ~/.config

这篇关于在npm上安装:未处理的拒绝错误:EACCES:权限被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆