diracdeltas / snowflake-cli

nodejs CLI tool for https://snowflake.torproject.org/
MIT License
9 stars 1 forks source link

Missing dependencies on Ubuntu-server #1

Closed straxus closed 2 years ago

straxus commented 2 years ago

Did an install on a minimal Ubuntu server, and ran into an exception:

vagrant@ubuntu-focal:~$ npm install snowflake-cli
⸨##################⸩ ⠸ reify:puppeteer: http fetch GET 200 https://registry.npmjs.org/puppeteer/-/puppeteer-13.4.0.tgz 3588ms (cache miss)

added 59 packages, and audited 60 packages in 10m

8 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
npm notice 
[snip]
npm notice 
vagrant@ubuntu-focal:~$ snowflake-cli
/usr/lib/node_modules/snowflake-cli/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:237
            reject(new Error([
                   ^

Error: Failed to launch the browser process!
/usr/lib/node_modules/snowflake-cli/node_modules/puppeteer/.local-chromium/linux-961656/chrome-linux/chrome: error while loading shared libraries: libxkbcommon.so.0: cannot open shared object file: No such file or directory

TROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md

    at onClose (/usr/lib/node_modules/snowflake-cli/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:237:20)
    at Interface.<anonymous> (/usr/lib/node_modules/snowflake-cli/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:227:68)
    at Interface.emit (node:events:532:35)
    at Interface.close (node:readline:586:8)
    at Socket.onend (node:readline:277:10)
    at Socket.emit (node:events:532:35)
    at endReadableNT (node:internal/streams/readable:1346:12)
    at processTicksAndRejections (node:internal/process/task_queues:83:21)
vagrant@ubuntu-focal:~$

Was able to resolve this by following suggestion in https://twitter.com/GEDSIC/status/1497942591807102978https://twitter.com/GEDSIC/status/1497942591807102978 to apt-get install certain dependent packages:

vagrant@ubuntu-focal:~$ sudo apt install libatk1.0-0 libatk-bridge2.0-0 libcups2 libxkbcommon0 libxdamage1 libgbm1 libpango-1.0-0 libcairo2

Then was able to launch snowflake-cli successfully:

vagrant@ubuntu-focal:~$ snowflake-cli
loaded
Snowflake: == snowflake proxy ==
Snowflake: Disabling Snowflake.
Snowflake: Currently not active.
Snowflake: Starting snowflake
Snowflake: Using snowflake.freehaven.net:443 as Relay.
Snowflake: Snowflake IDs: [redacted]
Snowflake: Polling broker..
NAT type: unknown
Your Snowflake is ready to help users circumvent censorship
Your Snowflake is ready to help users circumvent censorship
Snowflake: proxypair datachannel timed out waiting for open
Your Snowflake is ready to help users circumvent censorship
Your Snowflake is ready to help users circumvent censorship
Setting NAT type: restricted
Your Snowflake is ready to help users circumvent censorship
Your Snowflake is ready to help users circumvent censorship
Snowflake: Snowflake IDs: [redacted]
Snowflake: Polling broker..
NAT type: restricted
Your Snowflake is ready to help users circumvent censorship