firebase depends on
grpc, which isn’t set to build right on the Chromebook. This is because
node-pre-gyp, which is used to download precompiled binaries, is not setup correctly. In then uses
node-gyp to compile the C++ bindings directly, which is also not setup correctly.
We are going to adjust the settings of node-gyp to make it compile things right under
termux, and then we are going to tweak the
grpc package itself in our local cache to make it build correctly.
This took way to long to sort out.
Installing the Basics
pkg install nodejs python2 make clang pkg-config
cd /bin; ln -s python2 python
mkdir /tmp/t; cd /tmp/t
npm install -g yarn
Start the grpc install
yarn add grpc
- This should take a long time but then fail because
-zdefsis not a valid option.
Update node-gyp settings
First we update node-gyp, as talked about here.
cd ~/. node-gyp/8.9.3/include/node(or whatever version you have)
common.gpyito change references of
-fPIC, and get rid of
Update the grpc npm package in the yarn cache
cd ~/.cache/yarn/v1/npm-grpc(tab tab to find the actual version)
- open up
bindings.gypand remove the line ‘
-zdefs’ which for me is line 941
- Also in
-zdefsagain. Not sure where this is coming from but
clangdoesn’t like it.
Note that every time there’s another version of grpc released, you’ll need to update that version in your yarn cache!
Try to add again
rm -rf node_modules/grpc
yarn add grpc
And there you go. Does anyone have a better fix that they could share?