I'm a beginner in node.js. I would like to connect with API for training. I'm behind the company proxy. I have an api-key: http://numbersapi.com/2000/math?json and I want to connect via node-fetch, but I get an error in console:
Error: { FetchError: request to http://numbersapi.com/2000/math failed, reason: connect ECONNREFUSED 107.170.248.47:80
at ClientRequest.<anonymous> (C:\user\training\Node.js\number_API\node_modules\node-fetch\lib\index.js:1455:11)
at ClientRequest.emit (events.js:193:13)
at Socket.socketErrorListener (_http_client.js:397:9)
at Socket.emit (events.js:193:13)
at emitErrorNT (internal/streams/destroy.js:91:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)
at processTicksAndRejections (internal/process/task_queues.js:81:17)
message:
'request to http://numbersapi.com/2000/math failed, reason: connect ECONNREFUSED 107.170.248.47:80',
type: 'system',
errno: 'ECONNREFUSED',
code: 'ECONNREFUSED' }
I have set properties in .npmrc:
proxy=http://xxx.xxx.com:8080
https-proxy=http://xxx.xxx.com:8080
registry=https://registry.npmjs.org