-1

I just tried to install this: npm install firebase-tools -g and I keep getting this error:

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

I have all of the right permissions on my computer. I think this might be an issue on Firebase's end.

  • `I think this might be an issue on Firebase's end` no, because it's *your* computer telling *you* that *you* do not have permission to to create the folder `/usr/local/lib/node_modules/firebase-tools` - did you "try running the command again as root/Administrator" as suggested (root for linux, Administrator for Windows) – Bravo Mar 03 '22 at 00:16

1 Answers1

0

Run it again but with this command: sudo npm install firebase-tools -g --unsafe-perm=true --allow-root

Kyriazis
  • 71
  • 6
  • For reference: https://stackoverflow.com/questions/35954725/error-eacces-permission-denied-when-trying-to-install-eslint-using-npm – Kyriazis Mar 03 '22 at 00:18
  • in other words, "do as the error suggests" :p are you sure those options still apply? they are not documented anywhere (any more) – Bravo Mar 03 '22 at 00:25
  • you're right, if those flags don't work i'd suggest reinstalling node with a package manager: https://docs.npmjs.com/resolving-eacces-permissions-errors-when-installing-packages-globally – Kyriazis Mar 03 '22 at 01:17
  • 1
    I think the `sudo` part is enough - those flags are **old** – Bravo Mar 03 '22 at 01:24