当我尝试安装 angular 时权限被拒绝 [英] Permission denied when I try to install angular

查看:77
本文介绍了当我尝试安装 angular 时权限被拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Error: EACCES: permission denied, access \'/Users/gs/.npm-global/lib/node_modules/@angular/cli\'',
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'access',
npm ERR!   path:
npm ERR!    '/Users/gs/.npm-global/lib/node_modules/@angular/cli' }

The operation was rejected by your operating system.
It is likely you do not have the permissions to access this file as the current user

if you believe this might be a permissions issue, please double-check the
permissions of the file and its containing directories, or try running
the command again as root/Administrator (though this is not recommended).

当我尝试下载它下载的 sudo 版本但终端无法识别 ng 时,有什么有趣的地方.

What's interesting when I tried the sudo version it downloads but ng is not recognized in the terminal.

我的节点是 10.16.3,我的 npm 是 6.9.0

My node is 10.16.3 and my npm is 6.9.0

这是文件问题还是我的 Mac?

Is this a file issue or my Mac?

推荐答案

你可以找到这个问题的解决方案此处.
或者
只需按照此处.

You can find the solution of this question here.
Or
Simply follow the steps from here.

这篇关于当我尝试安装 angular 时权限被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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