firebase-tools fails to load via terminal install on macOS
Asked Answered
A

6

8

Trying to install firebase-tool for CLI. Getting failures.

running on macOS

I have seen suggestions like the following ...

Troubling with installing firebase-tools

I tried $ sudo npm install -g firebase-tools

Using 'sudo' gets past the error issues trying to access directories. but still crashes

The troubling bit seems to be this

 node-pre-gyp ERR! Tried to download(undefined):       https://storage.googleapis.com/grpc-precompiled-binaries/node/grpc/v1.4.1/node-v57-darwin-x64.tar.gz 

I can put the above URL in a browser and it will download the tar.

I also have access problem even if I use 'sudo'

 gyp ERR! stack Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/firebase-tools/node_modules/grpc/build'

Trying to understand how to get past the errors to install firebase-tools, Also some suggestions say to install node via nvm. Found tutorial on nvm, anyone know what doing this install will to to projects I already have on my machine. e.g confusion finding correct node.js, or need to reinstall everything that I already installed using my current node install?

The full error messages are ...

  sudo npm install -g firebase-tools
  Password:
  npm WARN deprecated [email protected]: Use uuid module instead
  /usr/local/bin/firebase -> /usr/local/lib/node_modules/firebase-     tools/bin/firebase

  > [email protected] install /usr/local/lib/node_modules/firebase-   tools/node_modules/grpc
  > node-pre-gyp install --fallback-to-build --library=static_library

  node-pre-gyp ERR! Tried to download(undefined):    https://storage.googleapis.com/grpc-precompiled-binaries/node/grpc/v1.4.1/node-    v57-darwin-x64.tar.gz 
 node-pre-gyp ERR! Pre-built binaries not found for [email protected] and      [email protected] (node-v57 ABI) (falling back to source compile with node-gyp) 
 gyp ERR! configure error 
 gyp ERR! stack Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/firebase-tools/node_modules/grpc/build'
 gyp ERR! System Darwin 17.3.0
 gyp ERR! command "/usr/local/bin/node"  "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js"  "configure" "--fallback-to-build" "--library=static_library" "-- module=/usr/local/lib/node_modules/firebase- tools/node_modules/grpc/src/node/extension_binary/grpc_node.node" "-- module_name=grpc_node" "--module_path=/usr/local/lib/node_modules/firebase-tools/node_modules/grpc/src/node/extension_binary"
 gyp ERR! cwd /usr/local/lib/node_modules/firebase-tools/node_modules/grpc
 gyp ERR! node -v v8.9.4
 gyp ERR! node-gyp -v v3.6.2
 gyp ERR! not ok 
 node-pre-gyp ERR! build error 
 node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/bin/node    /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure   --fallback-to-build --library=static_library --   module=/usr/local/lib/node_modules/firebase- tools/node_modules/grpc/src/node/extension_binary/grpc_node.node -- module_name=grpc_node --module_path=/usr/local/lib/node_modules/firebase- tools/node_modules/grpc/src/node/extension_binary' (1)
 node-pre-gyp ERR! stack     at ChildProcess.<anonymous>   (/usr/local/lib/node_modules/firebase-tools/node_modules/grpc/node_modules/node-  pre-gyp/lib/util/compile.js:83:29)
 node-pre-gyp ERR! stack     at emitTwo (events.js:126:13)
 node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
 node-pre-gyp ERR! stack     at maybeClose   (internal/child_process.js:925:16)
 node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
 node-pre-gyp ERR! System Darwin 17.3.0
 node-pre-gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/firebase-   tools/node_modules/grpc/node_modules/.bin/node-pre-gyp" "install" "--fallback-  to-build" "--library=static_library"
 node-pre-gyp ERR! cwd /usr/local/lib/node_modules/firebase-    tools/node_modules/grpc
 node-pre-gyp ERR! node -v v8.9.4
 node-pre-gyp ERR! node-pre-gyp -v v0.6.36
 node-pre-gyp ERR! not ok 
 Failed to execute '/usr/local/bin/node   /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure  --fallback-to-build --library=static_library -- module=/usr/local/lib/node_modules/firebase-  tools/node_modules/grpc/src/node/extension_binary/grpc_node.node -- module_name=grpc_node --module_path=/usr/local/lib/node_modules/firebase- tools/node_modules/grpc/src/node/extension_binary' (1)
 npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/firebase-tools/node_modules/grpc):
 npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] install: `node-   pre-gyp install --fallback-to-build --library=static_library`
 npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

 + [email protected]
 added 8 packages and updated 1 package in 37.194s

I also tried to cd in to the node_modules directory and run the install from there as proposed in this post

firebase-tools cannot install, why?

The result is pages and pages of warning messages and finally an error

 npm ERR! path /usr/local/lib/node_modules/firebase-tools/bin/firebase
 npm ERR! code ELOOP
 npm ERR! errno -62
 npm ERR! syscall chmod
 npm ERR! ELOOP: too many symbolic links encountered, chmod '/usr/local/lib/node_modules/firebase-tools/bin/firebase'
Airdrie answered 7/2, 2018 at 21:24 Comment(4)
I'd just go with nvm installed in your home directory, so you don't have to fiddle with permissions on stuff under /usr/local.Thibodeau
Thanks. will that conflict with already having node.js installed at root? Cleanup necessary or all-is-good and the home directory one will be found? Also, wondering then if I will need to reinstall all the things I already installed on node.js in root. Also not clear if the missing file is a permission issue related to the install at root. Wonder why the node-v57-darwin-x64.tar.gz is not found.Airdrie
Should be no conflict if you make sure the nvm node is ahead of the other node in your PATH. Those GRPC issues can be difficult - try using nvm to fall back to the latest 6.x version of node.Thibodeau
One follow-up. I re-instaled node using nvm. node is now in my home directory 'User/jc/' instead of root. That went fine. Then installed firebase and seem to go ok. got ... npm WARN jc No description npm WARN jc No repository field. npm WARN jc No license field. . I then installed angular/cli and that went ok. but for " $ ng help" I get "-bash: ng: command not found" does not find ng command support. Know how to fix?Airdrie
S
8
npm install -g firebase-tools

works on windows without causing any error. but when it comes to Mac you need to start it with sudo. so the command will be:

sudo npm install -g firebase-tools

then check the version using firebase -V on terminal to make sure you've done correctly.

Seeder answered 10/3, 2020 at 8:54 Comment(1)
in order to use firebase-tools in Mac after installing this way, I have to prefix with sudo for every command, example: sudo firebase --version. May be useful for someone coz I was struggling with it for a while.Spectrometer
S
4

I encountered the same problem what I did was made sure I was in root directory and the ran :

sudo npm i g firebase-tools

Or in Windows

npm i g firebase-tools

I was constantly doing it in my project folder and kept getting the same error.

Sasser answered 13/12, 2018 at 3:52 Comment(0)
G
3

In my case I had a corrupted Firebase install, solved by running:

curl -sL firebase.tools | upgrade=true bash

If you don't have Firebase already you can just run:

curl -sL firebase.tools

Reference: https://firebase.google.com/docs/cli#mac-linux-auto-script

Gerius answered 14/2, 2023 at 13:53 Comment(0)
U
1

I had the same problem on macOS High Sierra. The only thing that worked for me in the end was to uninstall node.js from Homebrew (brew uninstall node), then install node.js using the downloadable installer (https://nodejs.org/en/download/) then install the Firebase CLI using sudo: sudo npm install -g firebase-tools

After that, I still received the warnings, but could launch and configure Firebase. Not an ideal solution, but it is serving as a fix for me at the moment.

Urus answered 7/4, 2018 at 23:35 Comment(0)
V
0

sudo npm install -g firebase-tools

sudo worked for me!

Without sudo I was getting the following error:

Lewis-MacBook-Pro:demo-firebase-func leg$ npm install -g firebase-tools
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules
npm ERR! path /usr/local/lib/node_modules
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
npm ERR!  { Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
npm ERR!   stack: 'Error: EACCES: permission denied, access \'/usr/local/lib/node_modules\'',
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'access',
npm ERR!   path: '/usr/local/lib/node_modules' }
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/leg/.npm/_logs/2018-10-03T20_35_51_209Z-debug.log
Vauban answered 3/10, 2018 at 21:23 Comment(0)
I
0

Installing Node from the package on its website, rather than through Brew, solved this issue for me.

Indicator answered 19/5, 2020 at 16:46 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.