HELP: expo add firebase fails

expo diagnostics
Expo CLI 4.0.17 environment info:
System:
OS: Windows 10 10.0.19042
Binaries:
Node: 14.15.3 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.10 - C:\Users\ASUS\AppData\Roaming\npm\yarn.CMD
npm: 6.14.10 - C:\Program Files\nodejs\npm.CMD
npmPackages:
expo: ~40.0.0 => 40.0.0
react: 16.13.1 => 16.13.1
react-dom: 16.13.1 => 16.13.1
react-native: https://github.com/expo/react-native/archive/sdk-40.0.1.tar.gz => 0.63.2
react-native-web: ~0.13.12 => 0.13.18
Expo Workflow: managed

When I do expo add firebase it fails with a very very long error message, it’s failing at building grpc module.
I dumped all the log file but can’t attach here so I am dumping few last lines from the error logs.
Please help as I am a beginner trying to learn react native and expo but this is causing a huge blocker for me.


…infback.c
inffast.c
inflate.c
inftrees.c
trees.c
uncompr.c
zutil.c
win_delay_load_hook.cc
z.vcxproj → E:\React-Native\snapgram\node_modules\grpc\build\Release\libz.lib
gyp ERR! build error
gyp ERR! stack Error: C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:315:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
gyp ERR! System Windows_NT 10.0.19042
gyp ERR! command “C:\Program Files\nodejs\node.exe” “C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js” “build” “–fallback-to-build” “–library=static_library”
“–module=E:\React-Native\snapgram\node_modules\grpc\src\node\extension_binary\node-v83-win32-x64-unknown\grpc_node.node” “–module_name=grpc_node”
“–module_path=E:\React-Native\snapgram\node_modules\grpc\src\node\extension_binary\node-v83-win32-x64-unknown” “–napi_version=7” “–node_abi_napi=napi” “–napi_build_version=0” “–node_napi_label=node-v83”
gyp ERR! cwd E:\React-Native\snapgram\node_modules\grpc
gyp ERR! node -v v14.15.3
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute ‘node-gyp.cmd build --fallback-to-build --library=static_library
–module=E:\React-Native\snapgram\node_modules\grpc\src\node\extension_binary\node-v83-win32-x64-unknown\grpc_node.node --module_name=grpc_node
–module_path=E:\React-Native\snapgram\node_modules\grpc\src\node\extension_binary\node-v83-win32-x64-unknown --napi_version=7 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v83’ (1)
node-pre-gyp ERR! stack at ChildProcess. (E:\React-Native\snapgram\node_modules\node-pre-gyp\lib\util\compile.js:83:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:315:20)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:1048:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
node-pre-gyp ERR! System Windows_NT 10.0.19042
node-pre-gyp ERR! command “C:\Program Files\nodejs\node.exe” “E:\React-Native\snapgram\node_modules\node-pre-gyp\bin\node-pre-gyp” “install” “–fallback-to-build” “–library=static_library”
node-pre-gyp ERR! cwd E:\React-Native\snapgram\node_modules\grpc
node-pre-gyp ERR! node -v v14.15.3
node-pre-gyp ERR! node-pre-gyp -v v0.14.0
node-pre-gyp ERR! not ok
Failed to execute ‘node-gyp.cmd build --fallback-to-build --library=static_library --module=E:\React-Native\snapgram\node_modules\grpc\src\node\extension_binary\node-v83-win32-x64-unknown\grpc_node.node
–module_name=grpc_node --module_path=E:\React-Native\snapgram\node_modules\grpc\src\node\extension_binary\node-v83-win32-x64-unknown --napi_version=7 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v83’ (1)
yarnpkg exited with non-zero code: 1
Error: yarnpkg exited with non-zero code: 1
at ChildProcess.completionListener (C:\Users\ASUS\AppData\Roaming\npm\node_modules\expo-cli\node_modules@expo\spawn-async\src\spawnAsync.ts:65:13)
at Object.onceWrapper (events.js:422:26)
at ChildProcess.emit (events.js:315:20)
at ChildProcess.cp.emit (C:\Users\ASUS\AppData\Roaming\npm\node_modules\expo-cli\node_modules\cross-spawn\lib\enoent.js:34:29)
at maybeClose (internal/child_process.js:1048:16)
at Socket. (internal/child_process.js:439:11)
at Socket.emit (events.js:315:20)
at Pipe. (net.js:673:12)
…
at Object.spawnAsync [as default] (C:\Users\ASUS\AppData\Roaming\npm\node_modules\expo-cli\node_modules@expo\spawn-async\src\spawnAsync.ts:26:19)
at YarnPackageManager._runAsync (C:\Users\ASUS\AppData\Roaming\npm\node_modules\expo-cli\node_modules@expo\package-manager\src\NodePackageManagers.ts:288:31)
at YarnPackageManager.addAsync (C:\Users\ASUS\AppData\Roaming\npm\node_modules\expo-cli\node_modules@expo\package-manager\src\NodePackageManagers.ts:241:16)
at installAsync (C:\Users\ASUS\AppData\Roaming\npm\node_modules\expo-cli\src\commands\install.ts:129:3)
at Command. (C:\Users\ASUS\AppData\Roaming\npm\node_modules\expo-cli\src\exp.ts:346:7)

Hey @mikr13, you won’t be able to use the firebase package in a managed project due to it’s native dependencies. See: Error when installing firebase with blank managed workflow template

Cheers,
Adam

1 Like

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.