this is my first time working with npm and I can't seem to install express. I have reviewed other questions on SO but the errors that I am getting seem to be a bit different.
$ npm install express
npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
npm ERR! code ECONNREFUSED
npm ERR! syscall connect
npm ERR! errno ECONNREFUSED
npm ERR! FetchError: request to https://registry.npmjs.org/express failed, reason: connect ECONNREFUSED 104.16.16.35:443
npm ERR! at ClientRequest.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\minipass-fetch\lib\index.js:130:14)
npm ERR! at ClientRequest.emit (node:events:527:28)
npm ERR! at TLSSocket.socketErrorListener (node:_http_client:454:9)
npm ERR! at TLSSocket.emit (node:events:539:35)
npm ERR! at emitErrorNT (node:internal/streams/destroy:157:8)
npm ERR! at emitErrorCloseNT (node:internal/streams/destroy:122:3)
npm ERR! at processTicksAndRejections (node:internal/process/task_queues:83:21)
npm ERR! FetchError: request to https://registry.npmjs.org/express failed, reason: connect ECONNREFUSED 104.16.16.35:443
npm ERR! at ClientRequest.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\minipass-fetch\lib\index.js:130:14)
npm ERR! at ClientRequest.emit (node:events:527:28)
npm ERR! at TLSSocket.socketErrorListener (node:_http_client:454:9)
npm ERR! at TLSSocket.emit (node:events:539:35)
npm ERR! at emitErrorNT (node:internal/streams/destroy:157:8)
npm ERR! at emitErrorCloseNT (node:internal/streams/destroy:122:3)
npm ERR! at processTicksAndRejections (node:internal/process/task_queues:83:21) {
npm ERR! code: 'ECONNREFUSED',
npm ERR! errno: 'ECONNREFUSED',
npm ERR! syscall: 'connect',
npm ERR! address: '104.16.16.35',
npm ERR! port: 443,
npm ERR! type: 'system',
npm ERR! requiredBy: '.'
npm ERR! }
npm ERR!
npm ERR! If you are behind a proxy, please make sure that the
npm ERR! 'proxy' config is set properly. See: 'npm help config'
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\TE493874\AppData\Local\npm-cache\_logs\2022-08-05T12_25_29_151Z-debug-0.log
I am using a corporate laptop so this is perhaps where the issue lies. Any help would be greatly appreciated.
CodePudding user response:
I have seen this before on corporate laptops, specifically with npmjs.org. What sometimes companies do is block traffic entirely or re-encrypt the SSL connection through their datacenter (either forcing LAN traffic or requiring you to VPN to get internet and then doing it internal before leaving to the broad internet). This can wreak havoc on endpoints that they don't know anything about or decide they allow list instead of specifically blocklist. What your seeing there is your laptop being told there's no traffic allowed here (ECONNREFUSED).
Your best bet is to talk to IT dept, and see if they can let you through.
CodePudding user response:
I solved it. Quite a simple fix actually. I just tried to install the package when I was NOT connected to my companies servers :-/