Open aghents opened 2 weeks ago
Clone repo and install dependencies
$ npm install -g moeda
Use moeda as cli tool
Try to use the api
moeda 1 usd brl
it should convert currency correctly using api
Error GBP Converting currency... /opt/homebrew/lib/node_modules/moeda/node_modules/got/index.js:73 ee.emit('error', new got.RequestError(err, opts)); ^ ErrorClass [RequestError]: getaddrinfo ENOTFOUND api.ratesapi.io at ClientRequest. (/opt/homebrew/lib/node_modules/moeda/node_modules/got/index.js:73:21) at Object.onceWrapper (node:events:629:26) at ClientRequest.emit (node:events:514:28) at TLSSocket.socketErrorListener (node:_http_client:495:9) at TLSSocket.emit (node:events:514:28) at emitErrorNT (node:internal/streams/destroy:151:8) at emitErrorCloseNT (node:internal/streams/destroy:116:3) at process.processTicksAndRejections (node:internal/process/task_queues:82:21) { code: 'ENOTFOUND', host: 'api.ratesapi.io', hostname: 'api.ratesapi.io', method: 'GET', path: '/api/latest?base=USD&symbols=EUR,GBP,BRL' }
Node version: v20.5.1 npm version: 9.8.0 moeda version: 2.0.0 (latest)
It would be interesting to fix this issue using the following Open source API which is updated weekly and updates currency daily
https://github.com/fawazahmed0/exchange-api
Steps to reproduce
Clone repo and install dependencies
$ npm install -g moeda
Use moeda as cli tool
Try to use the api
moeda 1 usd brl
Expected behavior
it should convert currency correctly using api
Actual behavior
Error GBP Converting currency... /opt/homebrew/lib/node_modules/moeda/node_modules/got/index.js:73 ee.emit('error', new got.RequestError(err, opts)); ^ ErrorClass [RequestError]: getaddrinfo ENOTFOUND api.ratesapi.io at ClientRequest. (/opt/homebrew/lib/node_modules/moeda/node_modules/got/index.js:73:21)
at Object.onceWrapper (node:events:629:26)
at ClientRequest.emit (node:events:514:28)
at TLSSocket.socketErrorListener (node:_http_client:495:9)
at TLSSocket.emit (node:events:514:28)
at emitErrorNT (node:internal/streams/destroy:151:8)
at emitErrorCloseNT (node:internal/streams/destroy:116:3)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
code: 'ENOTFOUND',
host: 'api.ratesapi.io',
hostname: 'api.ratesapi.io',
method: 'GET',
path: '/api/latest?base=USD&symbols=EUR,GBP,BRL'
}
System configuration
Node version: v20.5.1 npm version: 9.8.0 moeda version: 2.0.0 (latest)