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

Installing Windows NodeJS causes problems when running npx and npm in WSL #37503

Open
bledking opened this issue Jan 5, 2025 · 0 comments
Open
Labels
goal: completeness (Experiment label) Issues about content missing important/relevant details. needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened.

Comments

@bledking
Copy link

bledking commented Jan 5, 2025

MDN URL

https://developer.mozilla.org/en-US/docs/Learn_web_development/Getting_started/Environment_setup/Command_line

What specific section or headline is this issue about?

No response

What information was incorrect, unhelpful, or incomplete?

After installing WSL and VSCode + WSL integration I installed NodeJS with the Windows .msi installer. I then installed Prettier and ran into issues when trying to run npx prettier, it was giving an "invalid URL" error. And running npx only would open cmd.exe instead of staying in bash. I had issues with npm as well.

My first step to fix was uninstalling NodeJS from Windows and reinstalling it in WSL with apt. Second step was adding this (AI-suggested fix) to ~/.bashrc because my PATH was still messed up:

export PATH=$(echo $PATH | sed -e 's|/mnt/c/Program Files/nodejs:||' -e 's|/mnt/c/Users/bledk/AppData/Roaming/npm:||')

What did you expect to see?

Document should suggest to install NodeJS through WSL, not Windows installer.

Do you have any supporting links, references, or citations?

No response

Do you have anything more you want to share?

No response

MDN metadata

Page report details
@bledking bledking added the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label Jan 5, 2025
@caugner caugner added the goal: completeness (Experiment label) Issues about content missing important/relevant details. label Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
goal: completeness (Experiment label) Issues about content missing important/relevant details. needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened.
Projects
None yet
Development

No branches or pull requests

2 participants