npm / npm/cli

[BUG] `https-proxy` config doesn't work with authenticated proxy

Open
#3,810 10 comments 9 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Bug Priority 2 Release 7.x
Dominant language
JavaScript
Stars
10.1k
Forks
4.7k
Avg merge
2d 2h
Merged PRs (30d)
19

Description

Is there an existing issue for this?
  • I have searched the existing issues
Current Behavior

when behind an authenticated http proxy, the following errors intermittently occur when attempting to npm install if using https
image

the only way around this seems to be to use http, which isn't ideal because it's being deprecated in a few days
image

since this issue is intermittent it's difficult for me to gather information to isolate the problem. it seems that deleting node_modules, running npm cache clean --force, and installing packages one at a time seem to sometimes effect the behavior, but i can't tell for sure

Expected Behavior

no errros

Steps To Reproduce
  1. run the following commands
    npm config set proxy http://username:password@proxy.example.com:8080
    npm config set https-proxy http://username:password@proxy.example.com:8080
    
  2. attempt to npm install (the errors occur intermittently, i can't reliably reproduce it) - see errors above
  3. run the following commands
    npm config set registry http://registry.npmjs.org/
    nom config set strict-ssl false
    
  4. run npm install again, no errors
Environment
  • OS: windows 10
  • Node: 16.9.1
  • npm: 7.24.1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No source file or test is named. Start by reproducing npm install on Windows 10 with authenticated proxy and HTTPS settings, then investigate the intermittent errors. Done means authenticated HTTPS-proxy installs complete without errors or requiring HTTP, registry changes, or disabled strict SSL.

Written by the indexing model from the issue text.

Assessment

Tech stack
nodejs
Domain
cli, networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.