GitSquared / node-geolite2-redist

Redistribution of MaxMind GeoLite2 GeoIP databases as an npm library
https://gitsquared.github.io/node-geolite2-redist/
Other
72 stars 15 forks source link

UnhandledPromiseRejectionWarning from rimraf in v2 #13

Closed justincy closed 3 years ago

justincy commented 3 years ago
(node:50918) UnhandledPromiseRejectionWarning: AssertionError [ERR_ASSERTION]: rimraf: callback function required
    at rimraf (/Users/justinyork/genward/genward-api/node_modules/geolite2-redist/node_modules/rimraf/rimraf.js:56:10)
    at /Users/justinyork/genward/genward-api/node_modules/geolite2-redist/index.js:90:6

I think it's caused by this line:

https://github.com/GitSquared/node-geolite2-redist/blob/f58b422ad11d4b15ac487245a745c3768c50cd50/index.js#L90

This is the error logged to the console right before it:

geolite2 self-update error: [Error: ENOENT: no such file or directory, open '/Users/justinyork/genward/genward-api/node_modules/geolite2-redist/dbs-tmp/GeoLite2-ASN.mmdb'] {
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: '/Users/justinyork/genward/genward-api/node_modules/geolite2-redist/dbs-tmp/GeoLite2-ASN.mmdb'
}
GitSquared commented 3 years ago

Will look into this today! It has affected my downstream repos too.

GitSquared commented 3 years ago

Shipped in https://github.com/GitSquared/node-geolite2-redist/releases/tag/v2.0.1

Thanks for reporting this!