question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Linux (Ubuntu 18.04) Nodejs execute problems

See original GitHub issue

Hi, 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:closed
  • Created 4 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Banneretscommented, Oct 18, 2019

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.

1reaction
Banneretscommented, Oct 17, 2019

Often you can get segfaults due to openssl version incompatibility https://github.com/ForNeVeR/tdlib.native/issues/3#issuecomment-461351718

Read more comments on GitHub >

github_iconTop Results From Across the Web

NodeJS 18 not working on Ubuntu 18.04 · Issue #1392 - GitHub
A fix for this problem would be to build NodeJS 18 on Debian Stretch, RHEL 7, Ubuntu 16.04 (which is still under ESM),...
Read more >
18.04 - Unable to install nodejs and npm correctly? - Ask Ubuntu
Once, curl is installed successfully, run the command to download and install the installer. curl -sL https://deb.nodesource.com/setup_12.x | ...
Read more >
How To Install Node.js on Ubuntu 18.04 - DigitalOcean
Ubuntu 18.04 contains a version of Node.js in its default ... Run the following command to verify that npm is installed and to...
Read more >
npm install fails on ubuntu 18.04 with error - node.js
I get below error while setting up a nodejs project on Ubuntu 18.04. The npm version installed is 6.x and the node version...
Read more >
How to Install Node.js and npm on Ubuntu 22.04 - Linuxize
Node.js is a cross-platform, open-source JavaScript runtime environment built on Chrome's JavaScript, designed to execute JavaScript code ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found