ngrok / ngrok-javascript

Embed ngrok secure ingress into your Node.js apps with a single line of code.
https://ngrok.com
Apache License 2.0
94 stars 18 forks source link

Install on Raspberry Pi #120

Closed endrehp closed 7 months ago

endrehp commented 7 months ago

Hi everyone,

I'm trying to install @ngrok/ngrok (version 1.0.0) on a raspberry pi (Linux ARM release: 4.19.97-v7l+). And I'm getting this error when I try to require the package in node:

Welcome to Node.js v16.17.0.
Type ".help" for more information.
> require('@ngrok/ngrok')
Uncaught:
Error: /home/pi/ngrok-test/node_modules/@ngrok/ngrok-linux-arm-gnueabihf/ngrok.linux-arm-gnueabihf.node: cannot open shared object file: No such file or directory
    at Object.Module._extensions..node (node:internal/modules/cjs/loader:1210:18)
    at Module.load (node:internal/modules/cjs/loader:1004:32)
    at Function.Module._load (node:internal/modules/cjs/loader:839:12)
    at Module.require (node:internal/modules/cjs/loader:1028:19)
    at require (node:internal/modules/cjs/helpers:102:18) {
  code: 'ERR_DLOPEN_FAILED'
}

I've tried checking dependencies, verifying permissions, and reinstalling ngrok. Any guidance on how to troubleshoot and resolve this issue?

bobzilladev commented 7 months ago

Hello, thanks for writing in! What version of Raspberry Pi are you using? Have you customized it at all? I can't duplicate an issue on a 4 Model B. There have been issues with glibc compatibility on older devices in the past, including 32-bit ones, however.

Building from source may also be a workaround in this case, with a Rust and Javascript build environment set up issuing yarn build will generate a binary locally.

Thanks for reporting the issue!

endrehp commented 7 months ago

Thank you!

I have a Raspberry Pi 4 Model B Rev 1.1 with 2GB ram and Linux ARM release: 4.19.97-v7l+. I managed to build the binary locally, and it works. Thanks for the suggestion! I guess there's a compatibility issue with the ngrok.linux-arm-gnueabihf.node file in the repo for my rpi version?

bobzilladev commented 7 months ago

Hi here, I was not able to load a raspios 2020-05-28 with 4.19.118-v7+ on the 4, errors on boot due to the software being too old. This 2021-12-02 with 5.10.63-v7+ runs ngrok-javascript without issue (I used node 14).

I'm happy that compiling it locally is working since that's probably the way forward here, but out of curiosity, what distribution are you running with the older 4.19.97-v7l+ kernel?

endrehp commented 7 months ago

I'm running Raspbian GNU/Linux 10 (buster). This solution works fine for me. Thanks again!

bobzilladev commented 7 months ago

Glad that solution is working for you! I'll close the issue, let us know if you run into anything else. Thanks!