aleixrodriala / wa-tunnel

Tunneling Internet traffic over Whatsapp
MIT License
2.08k stars 96 forks source link

ReferenceError: FinalizationRegistry is not defined #12

Closed alk99-abderrahman closed 1 year ago

alk99-abderrahman commented 1 year ago

when i try run the server side

abdo@abdo:~/wa-tunnel$ sudo node server.js 192.168.0.1 3128 2129*******
[sudo] password for abdo:
/home/abdo/wa-tunnel/node_modules/on-exit-leak-free/index.js:11
const registry = new FinalizationRegistry(clear)
                 ^

ReferenceError: FinalizationRegistry is not defined
    at Object.<anonymous> (/home/abdo/wa-tunnel/node_modules/on-exit-leak-free/index.js:11:18)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Module.require (internal/modules/cjs/loader.js:887:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/home/abdo/wa-tunnel/node_modules/pino/lib/tools.js:8:16)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
aleixrodriala commented 1 year ago

Looks like a pino error, I did a quick search and could be related with node version, which one are you using?

alk99-abderrahman commented 1 year ago

abdo@abdo:~/wa-tunnel$ nodejs -v v12.22.9

aleixrodriala commented 1 year ago

Seems like you need to be on nodejs >= 16.0

alk99-abderrahman commented 1 year ago

the server side was fixed thanks . now error in client side $ ls LICENSE client.js server.js wasocket.js README.md package.json utils.js $ node install node:internal/modules/cjs/loader:998 throw err; ^

Error: Cannot find module '/data/data/com.termux/files/home/wa-tunnel/install' at Module._resolveFilename (node:internal/modules/cjs/loader:995:15) at Module._load (node:internal/modules/cjs/loader:841:27) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) at node:internal/main/run_main_module:23:47 { code: 'MODULE_NOT_FOUND', requireStack: [] }

Node.js v18.12.1 Screenshot_20221121-204356_Termux

aleixrodriala commented 1 year ago

Its npm install not node install

aleixrodriala commented 1 year ago

I saw now that was wrong in README, already fixed, apologizes

aleixrodriala commented 1 year ago

I guess was fixed since I didn't get any reply

yoonsio commented 1 year ago

I have same issue running client:

/Users/me/workspace/wa-tunnel/node_modules/pino/node_modules/on-exit-leak-free/index.js:11
const registry = new FinalizationRegistry(clear)
                 ^

ReferenceError: FinalizationRegistry is not defined
    at Object.<anonymous> (/Users/op/workspace/wa-tunnel/node_modules/pino/node_modules/on-exit-leak-free/index.js:11:18)
    at Module._compile (internal/modules/cjs/loader.js:1015:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1035:10)
    at Module.load (internal/modules/cjs/loader.js:879:32)
    at Function.Module._load (internal/modules/cjs/loader.js:724:14)
    at Module.require (internal/modules/cjs/loader.js:903:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/Users/op/workspace/wa-tunnel/node_modules/pino/lib/tools.js:8:16)
    at Module._compile (internal/modules/cjs/loader.js:1015:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1035:10)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! wa-tunnel@1.0.0 client: `node src/client.js "8080" "16477385068"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the wa-tunnel@1.0.0 client script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/me/.npm/_logs/2023-06-05T19_44_28_544Z-debug.log

node: v12.19.0 npm: 6.14.11