尝试更新NPM时出现权限错误

时间:2019-06-24 14:06:26

标签: npm

最近一段时间以来我一直在做出反应,似乎从未出现任何问题。我开发的过去几个应用程序在创建类似要求运行“ npm audit fix”的应用程序时会发生奇怪的警告,我这样做并解决了一些错误。

对于最新的npm次要更新,我要从6.4.1-> 6.9.0进行更新,似乎每次尝试更新它时都缺少权限。

这是它吐出的错误

npm ERR! Error: EACCES: permission denied, access 
'/usr/local/lib/node_modules/npm/node_modules/aproba'
npm ERR!  { [Error: EACCES: permission denied, access '/usr/local/lib/node_modules/npm/node_modules/aproba']
npm ERR!   stack:
npm ERR!    'Error: EACCES: permission denied, access \'/usr/local/lib/node_modules/npm/node_modules/aproba\'',
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'access',
npm ERR!   path: '/usr/local/lib/node_modules/npm/node_modules/aproba' }
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/robert/.npm/_logs/2019-06-24T14_01_40_072Z-debug.log

0 个答案:

没有答案