Skip to content

[BUG] NPM install ignores HTTPS_PROXY envvar #6957

Closed
@MikeDombo

Description

@MikeDombo

Is there an existing issue for this?

  • I have searched the existing issues

This issue exists in the latest npm version

  • I am using the latest npm

Current Behavior

NPM install is failing behind a proxy with the proper HTTPS_PROXY environment variable set. It works if I use --proxy option instead, but this is a regression from previous versions.

Expected Behavior

NPM should use the HTTPS_PROXY environment variable to connect to the registry through a proxy

Steps To Reproduce

  1. With a proxy
  2. Set HTTPS_PROXY environment variable to the proxy URL
  3. Block access to the internet without a proxy (eg. windows firewall block 443 outbound)
  4. Try npm install any package
  5. npm install fails with a FetchError due to EACCES

Environment

  • npm: 10.1.0
  • Node.js: 20.9.0
  • OS Name: Windows Server 2019
  • System Model Name:
  • npm config:
; copy and paste output from `npm config ls` here
FetchError: request to https://registry.npmjs.org/aws-iot-device-sdk-v2 failed, reason:
    at ClientRequest.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\minipass-fetch\lib\index.js:130:14)
   at ClientRequest.emit (node:events:514:28)
   at _destroy (node:_http_client:875:13)
   at onSocketNT (node:_http_client:895:5)
   at process.processTicksAndRejections (node:internal/process/task_queues:83:21)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions