Installing Windows NodeJS causes problems when running npx and npm in WSL #37503
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.
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 runningnpx
only would open cmd.exe instead of staying in bash. I had issues withnpm
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
en-us/learn_web_development/getting_started/environment_setup/command_line
The text was updated successfully, but these errors were encountered: