我不断收到错误消息,指出我没有安装 Firebase 的正确权限,尽管我是计算机上的管理员



我刚试着安装这个:npm install firebase-tools -g,但我一直收到这个错误:

npm ERR! code EACCES
npm ERR! syscall mkdir
npm ERR! path /usr/local/lib/node_modules/firebase-tools
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/firebase-tools'
npm ERR!  [Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/firebase-tools'] {
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'mkdir',
npm ERR!   path: '/usr/local/lib/node_modules/firebase-tools'
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.
npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/xavierpereira/.npm/_logs/2022-03-02T18_57_53_604Z-debug-0.log

我对我的计算机拥有所有正确的权限。我认为这可能是Firebase方面的一个问题。

再次运行它,但使用以下命令:sudo npm install firebase-tools -g --unsafe-perm=true --allow-root

最新更新