当我试图为我的角度应用程序生成一个新的组件时,我会立即得到一个权限被拒绝的错误,但是我不知道为什么。我试图运行的命令是
ng g component heroes我已经在项目文件夹和所有包含的文件上尝试了chmod -R 755,但不幸的是,这并没有改变结果。
这是我在运行命令时收到的错误消息。
EACCES: permission denied, mkdir '/Users/mynamehere/Documents/Web Dev/projects/angular/angular-tour-of-heroes/src/app/heroes'
[Finished in 3.5s with exit code 1]
[cmd: ['ng', 'g', 'component', 'heroes']]
[dir: /Users/evanjameson/Documents/Web Dev/projects/angular/angular-tour-of-heroes]
[path: /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/smlnj/bin]这是来自崇高内部的AngularCLI包。当我在终端中运行相同的命令时,我会得到相同的错误消息。
发布于 2019-05-04 01:52:36
尝试chmod 777 (而不是755),查看生成的文件的所有者。可能崇高是在与你不同的环境下运行的。
https://stackoverflow.com/questions/55978787
复制相似问题