Firebase install is failing (need help)

Environment:

Srinivass-MacBook-Air:myApp sras$ ionic info

Ionic:

ionic (Ionic CLI) : 4.12.0 (/usr/local/lib/node_modules/ionic)
Ionic Framework : @ionic/angular 4.3.1
@angular-devkit/build-angular : 0.13.9
@angular-devkit/schematics : 7.3.9
@angular/cli : 7.3.9
@ionic/angular-toolkit : 1.5.1

System:

NodeJS : v12.1.0 (/usr/local/Cellar/node/12.1.0/bin/node)
npm : 6.9.0
OS : macOS Mojave

Command:

npm install firebase firebaseui @angular/fire firebaseui-angular

Errors:

CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/filters/workarounds/workaround_cronet_compression_filter.o
CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/filters/workarounds/workaround_utils.o
CXX(target) Release/obj.target/grpc/deps/grpc/src/core/plugin_registry/grpc_plugin_registry.o
LIBTOOL-STATIC Release/libgrpc.a
Traceback (most recent call last):
File “./gyp-mac-tool”, line 611, in
sys.exit(main(sys.argv[1:]))
File “./gyp-mac-tool”, line 28, in main
exit_code = executor.Dispatch(args)
File “./gyp-mac-tool”, line 43, in Dispatch
return getattr(self, method)(*args[1:])
File “./gyp-mac-tool”, line 246, in ExecFilterLibtool
if not libtool_re.match(line) and not libtool_re5.match(line):
TypeError: cannot use a string pattern on a bytes-like object
make: *** [Release/libgrpc.a] Error 1
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack at ChildProcess.emit (events.js:196:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:256:12)
gyp ERR! System Darwin 18.5.0
gyp ERR! command “/usr/local/Cellar/node/12.1.0/bin/node” “/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js” “build” “–fallback-to-build” “–library=static_library” “–module=/Users/sras/ionic-app/myApp/node_modules/grpc/src/node/extension_binary/node-v72-darwin-x64-unknown/grpc_node.node” “–module_name=grpc_node” “–module_path=/Users/sras/ionic-app/myApp/node_modules/grpc/src/node/extension_binary/node-v72-darwin-x64-unknown” “–napi_version=4” “–node_abi_napi=napi” “–napi_build_version=0” “–node_napi_label=node-v72”
gyp ERR! cwd /Users/sras/ionic-app/myApp/node_modules/grpc
gyp ERR! node -v v12.1.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute ‘/usr/local/Cellar/node/12.1.0/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --library=static_library --module=/Users/sras/ionic-app/myApp/node_modules/grpc/src/node/extension_binary/node-v72-darwin-x64-unknown/grpc_node.node --module_name=grpc_node --module_path=/Users/sras/ionic-app/myApp/node_modules/grpc/src/node/extension_binary/node-v72-darwin-x64-unknown --napi_version=4 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v72’ (1)
node-pre-gyp ERR! stack at ChildProcess. (/Users/sras/ionic-app/myApp/node_modules/grpc/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:196:13)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:1000:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:267:5)
node-pre-gyp ERR! System Darwin 18.5.0
node-pre-gyp ERR! command “/usr/local/Cellar/node/12.1.0/bin/node” “/Users/sras/ionic-app/myApp/node_modules/grpc/node_modules/.bin/node-pre-gyp” “install” “–fallback-to-build” “–library=static_library”
node-pre-gyp ERR! cwd /Users/sras/ionic-app/myApp/node_modules/grpc
node-pre-gyp ERR! node -v v12.1.0
node-pre-gyp ERR! node-pre-gyp -v v0.12.0
node-pre-gyp ERR! not ok
Failed to execute ‘/usr/local/Cellar/node/12.1.0/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --library=static_library --module=/Users/sras/ionic-app/myApp/node_modules/grpc/src/node/extension_binary/node-v72-darwin-x64-unknown/grpc_node.node --module_name=grpc_node --module_path=/Users/sras/ionic-app/myApp/node_modules/grpc/src/node/extension_binary/node-v72-darwin-x64-unknown --napi_version=4 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v72’ (1)
npm WARN @ionic/pro@2.0.4 requires a peer of cordova-plugin-ionic@^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN firebaseui-angular@3.4.1 requires a peer of @angular/common@^6.1.2 but none is installed. You must install peer dependencies yourself.
npm WARN firebaseui-angular@3.4.1 requires a peer of @angular/core@^6.1.2 but none is installed. You must install peer dependencies yourself.
npm WARN firebaseui-angular@3.4.1 requires a peer of @angular/fire@5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN firebaseui-angular@3.4.1 requires a peer of firebase@^5.3.1 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/fire@5.1.3 requires a peer of firebase@^5.5.0 but none is installed. You must install peer dependencies yourself.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! grpc@1.20.0 install: node-pre-gyp install --fallback-to-build --library=static_library
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the grpc@1.20.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/sras/.npm/_logs/2019-05-08T01_46_48_106Z-debug.log
Srinivass-MacBook-Air:myApp sras$

Please let me know if more details are required

I had the same with node v12.1.0, downgrading to v10.10.0 (by using nvm) solved the issue for me

Thank you Michele…

i tried this and working for me…

sudo npm cache clean -f
sudo npm install -g n
sudo n stable