linux(firetvにインストールしたtermux)下で、
nodeプログラムが以下の様にエラーで止まります。
FirebaseのRealtaime Databaseに保存したデータの更新を見張るプログラムです。
解決する方法をお教えください。

~ $ uname -a
Linux localhost 3.10.54+ #1 SMP PREEMPT Mon Apr 23 21:32:34 UTC 2018 armv7l Android
~ $ node -v
v9.11.1
~ $ echo $PATH
/data/data/com.termux/files/usr/bin:/data/data/com.termux/files/usr/bin/applets
~ $ npm bin -g
/data/data/com.termux/files/home/usr/local/bin
(not in PATH env variable)
~/ $ node firebase-listener.js
WARNING: linker: grpc_node.node: unused DT entry: type 0x6ffffef5 arg 0xb60
/data/data/com.termux/files/home/rm_mini3/node_modules/@firebase/firestore/node_modules/grpc/src/grpc_extension.js:57
    throw e;
    ^

Error: dlopen failed: cannot locate symbol "inflate" referenced by "grpc_node.node"...
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:683:18)
    at Module.load (internal/modules/cjs/loader.js:566:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:506:12)
    at Function.Module._load (internal/modules/cjs/loader.js:498:3)
    at Module.require (internal/modules/cjs/loader.js:598:17)
    at require (internal/modules/cjs/helpers.js:11:18)
    at Object.<anonymous> (/data/data/com.termux/files/home/rm_mini3/node_modules/@firebase/firestore/node_modules/grpc/src/grpc_extension.js:32:13)
    at Module._compile (internal/modules/cjs/loader.js:654:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:665:10)
    at Module.load (internal/modules/cjs/loader.js:566:32)

補足

npm install  firebase-tools
firebase login
firebase init

などは、おそらく問題ない。

同じソースが別の環境(ubuntu(WSL))では動きます。

https://github.com/termux/termux-packages
の一番下のほうに書いてあることに関係あるのかなと思っているのですが。
cannot locate symbol "inflate" referenced by "grpc_node.node"とあるので、
grpc_node.nodeが"inflate"を参照しているけれども、ライブラリファイルの
ロードができていないという意味でしょうか?
パスの問題なのか、何らかをソースからコンパイルする必要があるのか?
具体的にどうすればよいのかがわかりません。

以下6/13追記

~ $ pkg  install zlib1g-dev
Hit:1 https://termux.net stable InRelease
Reading package lists... Done
Building dependency tree
Reading state information... Done
All packages are up to date.
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package zlib1g-dev
~ $ find / -name libz.so 2>/dev/null
/system/lib/libz.so

以下6/13追記その2

~ $ echo $LD_LIBRARY_PATH
/system/lib:/data/data/com.termux/files/usr/lib
~ $ export LD_LIBRARY_PATH=/system/lib:$LD_LIBRARY_PATH
~ $ node firebase-listener.js
(上と同じエラーメッセージ)
~ $ cat /data/data/com.termux/files/home/rm_mini3/node_modules/@firebase/firestore/node_modules/grpc/src/grpc_extension.js
'use strict';

var binary = require('node-pre-gyp/lib/pre-binding');
var path = require('path');
var binding_path =
    binary.find(path.resolve(path.join(__dirname, '../package.json')));
var binding;
try {
  binding = require(binding_path);
} catch (e) {
  let fs = require('fs');
  let searchPath = path.dirname(path.dirname(binding_path));
  let searchName = path.basename(path.dirname(binding_path));
  let foundNames;
  try {
    foundNames = fs.readdirSync(searchPath);
  } catch (readDirError) {
    let message = `The gRPC binary module was not installed. This may be fixed by running "npm rebuild"
Original error: ${e.message}`;
    let error = new Error(message);
    error.code = e.code;
    throw error;
  }
  if (foundNames.indexOf(searchName) === -1) {
    let message = `Failed to load gRPC binary module because it was not installed for the current system
Expected directory: ${searchName}
Found: [${foundNames.join(', ')}]
This problem can often be fixed by running "npm rebuild" on the current system
Original error: ${e.message}`;
    let error = new Error(message);
    error.code = e.code;
    throw error;
  } else {
    throw e;  //ここでエラー
  }
}
module.exports = binding;