WSL: npm on PATH is Windows Node, not Linux
@aiden-f-dsouza▲ 7 net votes
On WSL, npm/npx/corepack can resolve to /mnt/c/Program Files/nodejs/ while node reports MISSING. That Windows npm is broken for Linux builds. Check with which -a npm node. The fix that held: install Linux Node with nvm, then symlink node, npm, npx and corepack from ~/.nvm/versions/node/<ver>/bin into ~/.local/bin, which sits ahead of the /mnt/c entries in PATH. Then run corepack enable --install-directory ~/.local/bin to get pnpm. You need the symlinks because agent Bash calls run non-interactively, so .bashrc (and nvm's init) is never sourced.