Linux (Ubuntu 18.04) Nodejs execute problems
See original GitHub issueHi, i’ve tried to work with tdl lib(tdl-tdlib-ffi) in a Linux (Ubuntu 18.04) install but i’ve some problems. This Linux is a Virtual Machine on a macbook pro. I’ve tested it also an a EC2 instance but the problem are the same.
If i try to do:
const { Client } = require('tdl') const { TDLib } require('tdl-tdlib-ffi')
i’ve this error:
(node:1867) UnhandledPromiseRejectionWarning: Error: Dynamic Linking Error: libtdjson.so: cannot open shared object file: No such file or directory at new DynamicLibrary (/home/buildy/Desktop/tdtest/node_modules/ffi-napi/lib/dynamic_library.js:74:11) at Object.Library (/home/buildy/Desktop/tdtest/node_modules/ffi-napi/lib/library.js:45:14) at new TDLib (/home/buildy/Desktop/tdtest/node_modules/tdl-tdlib-ffi/dist/index.js:36:36) at main (/home/buildy/Desktop/tdtest/index.js:8:31) at Object.<anonymous> (/home/buildy/Desktop/tdtest/index.js:4:1) at Module._compile (internal/modules/cjs/loader.js:778:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10) at Module.load (internal/modules/cjs/loader.js:653:32) at tryModuleLoad (internal/modules/cjs/loader.js:593:12) at Function.Module._load (internal/modules/cjs/loader.js:585:3) (node:1867) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1) (node:1867) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
On the contrary, if i try to do this:
const { Client } = require('./libtdjson.so') const { TDLib } = require('tdl-tdlib-ffi')
i’ve this error:
home/buildy/Desktop/tdtest/libtdjson.so:1 ELF ^
SyntaxError: Invalid or unexpected token at Module._compile (internal/modules/cjs/loader.js:723:23) at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10) at Module.load (internal/modules/cjs/loader.js:653:32) at tryModuleLoad (internal/modules/cjs/loader.js:593:12) at Function.Module._load (internal/modules/cjs/loader.js:585:3) at Module.require (internal/modules/cjs/loader.js:692:17) at require (internal/modules/cjs/helpers.js:25:18) at Object.<anonymous> (/home/buildy/Desktop/tdtest/index.js:1:20) at Module._compile (internal/modules/cjs/loader.js:778:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
I’ve tested with my compiled lib (built in the same environment) and a sample lib but the errors are the same.
My goal is to work with this in local virtual machine and then run it in a Lambda function. If i try to work directly with my compiled dylib in the macbook pro it works as expected.
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (3 by maintainers)
Top GitHub Comments
libtdjson
is dynamically linked against openssl, so you should have openssl of the specified version installed on your system. If you built it on the same machine, then it shouldn’t be a problem.Often you can get segfaults due to openssl version incompatibility https://github.com/ForNeVeR/tdlib.native/issues/3#issuecomment-461351718