ethglobal / speedtest

2 stars 1 forks source link

Error after test: ReferenceError: fetch is not defined #1

Open catmand00 opened 1 year ago

catmand00 commented 1 year ago

Full output:

ETHGlobal Speed Test

✔ Speed         15 Mbps 
✔ Latency       43 ms
✔ Elapsed       43s

 IP     172.18.0.1
 Mac    null

 Your internet speed is 14.93 Mbps on Sat, 23 Sep 2023 20:51:28 GMT 

file:///home/ligma/.npm/_npx/9cf3680a564fc667/node_modules/@ethglobal/speed/index.js:186
        const postUpdate = await fetch('https://speed.ethglobal.com/api/create', {
                           ^

ReferenceError: fetch is not defined
    at IncomingMessage.<anonymous> (file:///home/ligma/.npm/_npx/9cf3680a564fc667/node_modules/@ethglobal/speed/index.js:186:28)

System info:

> lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.3 LTS
Release:        22.04
Codename:       jammy
> node -v
v16.14.0
> npm --version
8.3.1
KartikTalwar commented 1 year ago

thanks for reporting! we assumed fetch would be default available in v16 but can add a dependency check in case it isnt available

catmand00 commented 1 year ago

Thanks for the suggestion, I have upgraded to v20.7.0 and problem is resolved