sagarkarira / coronavirus-tracker-cli

Track conronavirus cases from command line. curl https://corona-stats.online/

Home Page:https://corona-stats.online/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Source 1 Causes TypeError

bill-luu opened this issue · comments

Fresh installation through npm install, using source 1:

bill@bill-HP-Notebook:~/Documents/SolarCar/Epsilon-Telemetry-Test-Tool$ corona --source=1
TypeError: Cannot read property 'latest' of undefined
    at confirmed.locations.forEach.obj (/usr/local/lib/node_modules/coronavirus-tracker-cli/lib/corona.js:40:41)
    at Array.forEach (<anonymous>)
    at getDataByCountry (/usr/local/lib/node_modules/coronavirus-tracker-cli/lib/corona.js:31:23)
    at exports.getCompleteTable (/usr/local/lib/node_modules/coronavirus-tracker-cli/lib/corona.js:116:23)
    at process._tickCallback (internal/process/next_tick.js:68:7)

source=2 works fine.

OS Information:

bill@bill-HP-Notebook:~/Documents/SolarCar/Epsilon-Telemetry-Test-Tool$ cat /etc/os-release
NAME="elementary OS"
VERSION="5.0 Juno"
ID=elementary
ID_LIKE=ubuntu
PRETTY_NAME="elementary OS 5.0 Juno"
LOGO=distributor-logo
VERSION_ID="5.0"
HOME_URL="https://elementary.io/"
SUPPORT_URL="https://elementary.io/support"
BUG_REPORT_URL="https://github.com/elementary/appcenter/issues/new"
PRIVACY_POLICY_URL="https://elementary.io/privacy-policy"
VERSION_CODENAME=juno
UBUNTU_CODENAME=bionic

On node version 12.16.1

I think updating the package will solve this.

Yeah I think that's the case, but I updated and now I have:

bill@bill-HP-Notebook:~/Documents/SolarCar/Epsilon-Embedded-Software$ corona
internal/modules/cjs/loader.js:985
  throw err;
  ^

Error: Cannot find module '../lib/country/us'
Require stack:
- /usr/local/lib/node_modules/coronavirus-tracker-cli/bin/index.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:982:15)
    at Function.Module._load (internal/modules/cjs/loader.js:864:27)
    at Module.require (internal/modules/cjs/loader.js:1044:19)
    at require (internal/modules/cjs/helpers.js:77:18)
    at Object.<anonymous> (/usr/local/lib/node_modules/coronavirus-tracker-cli/bin/index.js:10:25)
    at Module._compile (internal/modules/cjs/loader.js:1158:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
    at Module.load (internal/modules/cjs/loader.js:1002:32)
    at Function.Module._load (internal/modules/cjs/loader.js:901:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/usr/local/lib/node_modules/coronavirus-tracker-cli/bin/index.js'
  ]
}

I think the country folder isn't on npm