每次我尝试使用npm(在这种情况下是electron-packager)安装某些东西时,我都会遇到这个错误。我该如何解决这个问题?
我已经尝试通过更改.npm的权限来让我获得访问权限,但它没有起作用。我还尝试了使用另一个node版本(通过nvm安装:node -v 12.1.0; npm -v 6.9.0),但同样不起作用。
我已经尝试通过更改.npm的权限来让我获得访问权限,但它没有起作用。我还尝试了使用另一个node版本(通过nvm安装:node -v 12.1.0; npm -v 6.9.0),但同样不起作用。
$ npm install electron-packager --save-dev
npm ERR! path /Users/felixmoser/.npm/_cacache/index-v5/15/a0
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall mkdir
npm ERR! Error: EACCES: permission denied, mkdir '/Users/felixmoser/.npm/_cacache/index-v5/15/a0'
npm ERR! [OperationalError: EACCES: permission denied, mkdir '/Users/felixmoser/.npm/_cacache/index-v5/15/a0'] {
npm ERR! cause: [Error: EACCES: permission denied, mkdir '/Users/felixmoser/.npm/_cacache/index-v5/15/a0'] {
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'mkdir',
npm ERR! path: '/Users/felixmoser/.npm/_cacache/index-v5/15/a0'
npm ERR! },
npm ERR! isOperational: true,
npm ERR! stack: 'Error: EACCES: permission denied, mkdir ' +
npm ERR! "'/Users/felixmoser/.npm/_cacache/index-v5/15/a0'",
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'mkdir',
npm ERR! path: '/Users/felixmoser/.npm/_cacache/index-v5/15/a0',
npm ERR! parent: 'electron-packager'
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/felixmoser/.npm/_logs/2019-05-01T14_11_08_530Z-debug.log
我其实不知道还有什么尝试的方法,希望你们能够帮我解决这个问题!