在安装项目级软件包时出现EACCESS错误

时间:2019-10-02 17:12:22

标签: npm permissions npm-install angular-cdk

当我尝试安装Angular材质包(通过npm install @angular/cdk)时,出现以下错误:

npm ERR! path /Users/codybugz/Documents/spinmusicapp/src_code/node_modules/babel-register/node_modules/babel-core
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
npm ERR! Error: EACCES: permission denied, access '/Users/codybugz/Documents/spinmusicapp/src_code/node_modules/babel-register/node_modules/babel-core'
npm ERR!  { [Error: EACCES: permission denied, access '/Users/codybugz/Documents/spinmusicapp/src_code/node_modules/babel-register/node_modules/babel-core']
npm ERR!   stack:
npm ERR!    'Error: EACCES: permission denied, access \'/Users/codybugz/Documents/spinmusicapp/src_code/node_modules/babel-register/node_modules/babel-core\'',
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'access',
npm ERR!   path:
npm ERR!    '/Users/codybugz/Documents/spinmusicapp/src_code/node_modules/babel-register/node_modules/babel-core' }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator (though this is not recommended).

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/codybugz/.npm/_logs/2019-10-02T17_03_03_090Z-debug.log

我已经对npm中的EACCESS错误进行了一些研究,但它们似乎都只与安装全局软件包有关。在这种情况下,我在一个简单的Documents目录上遇到了错误,我100%确信我拥有。的权限。

我不想在运行sudo时尝试使用它,因为这可能是一个安全问题。

有人知道如何解决此问题吗?

0 个答案:

没有答案