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
在终端中无法识别时,有趣的是。
我的节点是10.16.3,我的npm是6.9.0
这是文件问题还是Mac?
答案 0 :(得分:1)
答案 1 :(得分:0)
在命令行中,在您的主目录中,为全局安装创建一个目录:
mkdir ~/.npm-global
配置 npm 以使用新的目录路径:
npm 配置设置前缀'~/.npm-global'
在您首选的文本编辑器中,打开或创建一个 ~/.profile 文件并添加以下行:
导出路径=~/.npm-global/bin:$PATH
在命令行上,更新您的系统变量:
源 ~/.profile
您可以全局安装软件包
npm install -g @angular/cli