Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
1 task done
melusc opened this issue Oct 25, 2021 · 2 comments
Closed
1 task done

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

melusc opened this issue Oct 25, 2021 · 2 comments
Labels
Bug thing that needs fixing Priority 1 high priority issue Release 8.x work is associated with a specific npm 8 release

Comments

@melusc
Copy link

melusc commented Oct 25, 2021

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
@melusc melusc added Bug thing that needs fixing Needs Triage needs review for next steps Release 8.x work is associated with a specific npm 8 release labels Oct 25, 2021
@fritzy fritzy added Priority 1 high priority issue and removed Needs Triage needs review for next steps labels Oct 25, 2021
@fritzy
Copy link
Contributor

fritzy commented Oct 25, 2021

I was able to reproduce this with a clean install of Node.js using the MSI installer.

@onyri
Copy link

onyri commented Nov 4, 2021

the file protocol prefix must be either 'file://localhost/' or simply 'file:///'.
apparently in Windows the prefix 'file://' is no longer accepted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing Priority 1 high priority issue Release 8.x work is associated with a specific npm 8 release
Projects
None yet
Development

No branches or pull requests

4 participants