fnm/nvm node installs are not found on Windows
This is a very old issue but I'm failing to find it in search.
- Be on Windows
- Install Node.js as recommended with winget+fnm on https://nodejs.org/en/download
- Open VS Code
- Do something that expects
nodeon the path, like starting an MCP server - 🐛 you get an ENOENT
Maybe for VSCode issue they were these ones:
- https://github.com/microsoft/vscode/issues/246252
- https://github.com/microsoft/vscode/issues/246293
About ENOENT:
- https://github.com/Schniz/fnm/issues/1379
- https://stackoverflow.com/questions/78522961/running-into-a-problem-installing-node-js-via-powershell-using-fnm
Hope that helps.
@connor4312 as you seem to have a repro can you take the lead to investigate this?
Some questions
Open VS Code
How, from CLI or task bar?
Do something that expects node on the path, like starting an MCP server
Where is the MCP server started, in core or the extension host and how?
Oh, I just realised that this is for Windows. We do not resolve any shell environment on that platform because at least back when we implemented shell resolution, Windows did not have any custom profiles, like macOS or Linux has:
https://github.com/microsoft/vscode/blob/6817c06175d99e9de1d31299629c3027e29c6766/src/vs/platform/shell/node/shellEnv.ts#L41-L46
Typically on Windows, all variables are defined globally and thus are always present, irrespective if you launch from UI or terminal.
So it seems to me that this combination of fnm/nvm needs new support for resolving on startup. I.e. a windows implementation of this method:
https://github.com/microsoft/vscode/blob/6817c06175d99e9de1d31299629c3027e29c6766/src/vs/platform/shell/node/shellEnv.ts#L102
Verification:
- Install Node.js as recommended with winget+fnm on https://nodejs.org/en/download
- if you miss a powershell profile, run
if (-not (Test-Path $profile)) { New-Item $profile -Force }in powershell - you might need to enable
Unrestrictedexecution policy in powershell - add to powershell profile
fnm env --use-on-cd --shell powershell | Out-String | Invoke-Expression - verify that node can be found when running VS Code from taskbar or launcher