Skip to content

pnpm 11 cannot publish to npmjs with https_proxy env variable set #11561

@OpportunityLiu

Description

@OpportunityLiu

Verify latest release

  • I verified that the issue exists in the latest pnpm release

pnpm version

11

Which area(s) of pnpm are affected? (leave empty if unsure)

No response

Link to the code that reproduces this issue or a replay of the bug

No response

Reproduction steps

Setup proxy with env variable https_proxy=xxx and then use pnpm publish to publish to npmjs. It will prompt with auth url and QR code, but will never continue even if you have passed auth in browser.

Describe the Bug

The publish procedure uses libnpmpublish, which will use proxy provided in env. While pollForWebAuthToken uses undici, which will not use proxy by default.

When first attempt to publish, proxy is used and authUrl/doneUrl is returned. When checking done status in pollForWebAuthToken, proxy is not used. So the ip address is different from the previous, result in the doneUrl always respond 403.

Expected Behavior

Use proxy to visit doneUrl. Able to publish normally.

Which Node.js version are you using?

24.15.0

Which operating systems have you used?

  • macOS
  • Windows
  • Linux

If your OS is a Linux based, which one it is? (Include the version if relevant)

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions