节点(错误:dlopen失败:找不到符号)

时间:2018-06-15 06:30:35

标签: javascript android node.js linux firebase

在linux下(在firetv上安装的termux) 节点程序因错误停止,如下所示。 这是一个监视Firebase Realtaime数据库中保存的数据更新的程序。 请告诉我如何解决它。

    ~ $ uname -a        #FireOS5 is based Android 5.1.
    Linux localhost 3.10.54+ # 1 SMP PREEMPT Mon Apr 23 21:32:34 UTC 2018 armv7l Android
    ~ $ npm install firebase-tools
    (omit some details)
    ~ $ firebase login
    (omit some details)
    ~ $ firebase init
    (omit some details)
    ~ $ node -v
    v9.11.1
    ~ $ echo $ PATH
    /data/data/com.termux/files/usr/bin:/data/data/com.termux/files/usr/bin/applets
~ $ echo $ LD_LIBRARY_PATH
/system/lib:/data/data/com.termux/files/usr/lib
    ~ $ find / -name libz.so 2> / dev / null
    /system/lib/libz.so
~ $ export LD_LIBRARY_PATH = / system / lib: $ LD_LIBRARY_PATH
    ~ / $ 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: can not 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 / rrm / mini 3 /
        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)

补编

同一个源在另一个环境(ubuntu(WSL,intel windows))中运行正常。

https://github.com/termux/termux-packages 我想知道它是否与页面底部的内容有关。 找不到符号&#34;膨胀&#34;由&#34; grpc_node.node&#34;引用 虽然grpc_node.node引用&#34; inflate&#34;,但是库文件 这是否意味着你无法加载?这是否意味着我必须改变一些静态链接的东西? 这是路径问题吗?还是我需要从源代码编译一些东西? 我不知道该怎么做。

/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 (',')}]
"Npm rebuild" on the current system
Original error: $ {e.message} `;
let error = new Error (message);
error.code = e.code;
throw error;
} else {
throw e; // HERE! the error 
}
}
module.exports = binding;

0 个答案:

没有答案