WSL Not Working
Status Fixed / completed
Maintainer reply ✓ Yes — ashwin-ant
Activity 8 comments · opened Feb 26, 2025 · closed Feb 26, 2025
💡 Likely answer: A maintainer (ashwin-ant, collaborator)
responded on this thread — see the highlighted reply below.
8 Comments
@NakiriYuuzu what WSL distro are you running? Also what version of WSL are you on?
Windows 11 - 24H2
WSL[2.3.26] - Ubuntu-24.04
Can you try running
npm config set os linuxand try again? Or if that doesn't work, trynpm install -g @anthropic-ai/claude-code --force --no-os-check?@ashwin-ant installing using --no-os-check still throws this error while running the claude command:
AppData/Roaming/npm/claude: 15: exec: node: not foundRunning WSL 2.4.11 on Win11, Ubuntu 22.04.3LTS
And the
npm config set os linuxoption didn't work either, correct?Can you also try running
which npmand see if you get a Linux path (/usr/bin/npmor similar) or a Windows path (/mnt/c/...)? If it's a Windows path, you may need to install a Linux build ofnpmvianvmorapt-get.I tried it on WSL, but the result was the same as yours. However, when I switched to PowerShell, it worked fine. So confused.
Yes, the npm path in WSL is set to the Windows path. You need to change it to the Linux path.
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.