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.

View original on GitHub ↗

8 Comments

ashwin-ant collaborator · 1 year ago

@NakiriYuuzu what WSL distro are you running? Also what version of WSL are you on?

NakiriYuuzu · 1 year ago
@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

ashwin-ant collaborator · 1 year ago

Can you try running npm config set os linux and try again? Or if that doesn't work, try npm install -g @anthropic-ai/claude-code --force --no-os-check?

patched-admin · 1 year ago

@ashwin-ant installing using --no-os-check still throws this error while running the claude command:
AppData/Roaming/npm/claude: 15: exec: node: not found

Running WSL 2.4.11 on Win11, Ubuntu 22.04.3LTS

ashwin-ant collaborator · 1 year ago

And the npm config set os linux option didn't work either, correct?

Can you also try running which npm and see if you get a Linux path (/usr/bin/npm or similar) or a Windows path (/mnt/c/...)? If it's a Windows path, you may need to install a Linux build of npm via nvm or apt-get.

NakiriYuuzu · 1 year ago
@ashwin-ant installing using --no-os-check still throws this error while running the claude command: AppData/Roaming/npm/claude: 15: exec: node: not found Running WSL 2.4.11 on Win11, Ubuntu 22.04.3LTS

I tried it on WSL, but the result was the same as yours. However, when I switched to PowerShell, it worked fine. So confused.

NakiriYuuzu · 1 year ago
And the npm config set os linux option didn't work either, correct? Can you also try running which npm and see if you get a Linux path (/usr/bin/npm or similar) or a Windows path (/mnt/c/...)? If it's a Windows path, you may need to install a Linux build of npm via nvm or apt-get.

Yes, the npm path in WSL is set to the Windows path. You need to change it to the Linux path.

github-actions[bot] · 1 year ago

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.