Skip to content

[BUG] npm help <term> throws on windows #3941

@melusc

Description

@melusc

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Using npm help ls throws on windows (because it is an invalid url, because it encodes backslashes):

npm ERR! Invalid URL: file://C:%5CUsers%5Clucas%5CAppData%5CRoaming%5Cnpm%5Cnode_modules%5Cnpm%5Cdocs%5Coutput%5Ccommands%5Cnpm-ls.html

Expected Behavior

It should produce and open a valid url with

  • either non-encoded backslashes
  • or forward slashes for file:// urls (since firefox and chrome normalise to that anyway).

Steps To Reproduce

  1. Run npm help ls on Windows
  2. See error about an invalid url as seen above.

Environment

  • OS: Windows 11
  • Node: 17.0.1
  • npm: 8.1.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bugthing that needs fixingPriority 1high priority issueRelease 8.xwork is associated with a specific npm 8 release

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions