Richienb / iplocation

Get ip location information.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error to use the IpLocation

robertgon97 opened this issue · comments

Describe the bug
I can't run the library because it gives me a JSON error.

Example
async function myFunction(req, res, next) {
try {
console.log( await ipLocation('172.217.167.78') )
} catch (error) {
console.log(error)
}
}

Expected behavior
I expected a response from the bookstore.

Output log
SyntaxError: Unexpected end of JSON input
at JSON.parse ()
at C:~~~~~\node_modules\ip-location\index.js:12:23
at done (C:~~~~~\node_modules\ip-location\http-get.js:13:5)
at IncomingMessage. (C:~~~~~\node_modules\ip-location\http-get.js:24:7)
at IncomingMessage.emit (events.js:327:22)
at endReadableNT (_stream_readable.js:1220:12)
at processTicksAndRejections (internal/process/task_queues.js:84:21)

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser EDGE
  • Version 86.0.622.69

Additional context
Add any other context about the problem here.