Skip to content

Conversation

@MaxBlack-dev
Copy link
Contributor

Fixes #4170

Description

This PR makes
pm config list display proxy-related environment variables when they are set.

Changes

  • Modified lib/commands/config.js to display HTTP_PROXY, HTTPS_PROXY, NO_PROXY and their lowercase variants when set
  • Added test case in est/lib/commands/config.js to verify the new behavior
  • Environment variables appear in a new ; environment-related config section

Motivation

As reported in #4170,
pm config list was not showing environment variables like HTTP_PROXY, NOPROXY, etc., even though these variables affect how npm runs. This made it difficult for users to see what proxy settings their environment has and could lead to mistakes.

Testing

Manual testing confirms:

  • When proxy environment variables are set, they appear in the output
  • When they are not set, the section doesn't appear
  • Both uppercase and lowercase variants are shown when present

The new test case verifies that environment variables are displayed correctly.

@MaxBlack-dev MaxBlack-dev requested a review from a team as a code owner December 4, 2025 19:35
@MaxBlack-dev MaxBlack-dev force-pushed the fix/4170-show-proxy-env-vars branch 2 times, most recently from 3341cf4 to f0b2737 Compare December 4, 2025 19:40
@MaxBlack-dev MaxBlack-dev force-pushed the fix/4170-show-proxy-env-vars branch from f0b2737 to 9c29072 Compare December 5, 2025 02:01
@MaxBlack-dev MaxBlack-dev force-pushed the fix/4170-show-proxy-env-vars branch from 68bebc0 to 4c2b641 Compare December 12, 2025 19:20
@wraithgar
Copy link
Member

This looks good. Are you comfortable enough with git to pull out the changes in the config workspace to their on commit? Our versioning is automatic based on conventional commit messages and the one for this PR doesn't fit with that change in the workspace package. It'd want to be something specific like feat: export environment config variable names.

If not we can do it but then the commit authorship wouldn't be wholly yours, if that matters to you.

Max Black added 2 commits December 15, 2025 14:15
Adds proxy-related environment variables to npm config list output
to help users understand their proxy configuration. Variables are
checked case-insensitively to match the agent library behavior.

Closes npm#4170
@MaxBlack-dev MaxBlack-dev force-pushed the fix/4170-show-proxy-env-vars branch from 4c2b641 to 40be7bb Compare December 15, 2025 22:16
@MaxBlack-dev
Copy link
Contributor Author

MaxBlack-dev commented Dec 15, 2025

This looks good. Are you comfortable enough with git to pull out the changes in the config workspace to their on commit? Our versioning is automatic based on conventional commit messages and the one for this PR doesn't fit with that change in the workspace package. It'd want to be something specific like feat: export environment config variable names.

If not we can do it but then the commit authorship wouldn't be wholly yours, if that matters to you.

I've split this into two commits:

  1. eat: export environment config variable names - Exports the proxyEnv list from @npmcli/config
  2. eat: show proxy environment variables in npm config list - Uses that list in the main package

This allows proper versioning for the config workspace package.

@wraithgar
Copy link
Member

Thanks! The config list snapshot changes seem to be something else that fell through the cracks but they're not enough to block merging this PR.

@wraithgar wraithgar merged commit 545e861 into npm:latest Dec 16, 2025
33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] npm config list should show HTTP_PROXY/HTTPS_PROXY/NOPROXY

2 participants