npm ERR!错误:EACCES:权限被拒绝,处于打开状态

时间:2019-06-13 11:33:32

标签: node.js

我正在尝试使用npm install从一个已经存在的react项目中安装我的依赖项,但是,每次我尝试运行npm install时,都会出现此错误。

有人知道现在为什么会这样吗?在安装和卸载之前,我已经完成了几个项目,完全没有问题。

npm WARN deprecated fsevents@2.0.6: Please update: there are crash fixes
npm WARN deprecated left-pad@1.3.0: use String.prototype.padStart()
npm ERR! path /Users/gabrielnessi/.npm/_cacache/index-v5/35/e4/300bcd6d6b07328b3cffb3509f86bc1ac535a870f8fe27c074a299d8c732
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall open
npm ERR! Error: EACCES: permission denied, open '/Users/gabrielnessi/.npm/_cacache/index-v5/35/e4/300bcd6d6b07328b3cffb3509f86bc1ac535a870f8fe27c074a299d8c732'
npm ERR!  [OperationalError: EACCES: permission denied, open '/Users/gabrielnessi/.npm/_cacache/index-v5/35/e4/300bcd6d6b07328b3cffb3509f86bc1ac535a870f8fe27c074a299d8c732'] {
npm ERR!   cause: [Error: EACCES: permission denied, open '/Users/gabrielnessi/.npm/_cacache/index-v5/35/e4/300bcd6d6b07328b3cffb3509f86bc1ac535a870f8fe27c074a299d8c732'] {
npm ERR!     errno: -13,
npm ERR!     code: 'EACCES',
npm ERR!     syscall: 'open',
npm ERR!     path: '/Users/gabrielnessi/.npm/_cacache/index-v5/35/e4/300bcd6d6b07328b3cffb3509f86bc1ac535a870f8fe27c074a299d8c732'
npm ERR!   },
npm ERR!   isOperational: true,
npm ERR!   stack: 'Error: EACCES: permission denied, open ' +
npm ERR!     "'/Users/gabrielnessi/.npm/_cacache/index-v5/35/e4/300bcd6d6b07328b3cffb3509f86bc1ac535a870f8fe27c074a299d8c732'",
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'open',
npm ERR!   path: '/Users/gabrielnessi/.npm/_cacache/index-v5/35/e4/300bcd6d6b07328b3cffb3509f86bc1ac535a870f8fe27c074a299d8c732',
npm ERR!   parent: 'eslint-plugin-jsx-a11y'
npm ERR! }
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/gabrielnessi/.npm/_logs/2019-06-13T11_28_05_702Z-debug.log```

1 个答案:

答案 0 :(得分:0)

您可能以root用户身份创建项目,现在尝试以简单用户的身份将模块安装在同一文件夹中。您需要以root用户身份登录才能授予用户权限,或者更改文件夹所有者或删除并重新创建项目文件夹