Windows install did not add PATH environment after installed node.
I did fnm install 22 and need to manually add the path to an installation manually. C:\Users\username\appdata\Roaming\fnm\node-versions\v22.14.0\installation
This solution works: https://stackoverflow.com/questions/78606679/unable-to-install-and-use-nodejs-using-fnm/78619685#78619685
👋 @Schniz checking in on this one -- this is the install path we're recommending by default on nodejs.org for Windows users now, and folks are getting stuck due to this. Is this an issue with the Winget script, or do we need to include shell setup in the instructions we're showing (the README here doesn't point to manual shell setup for winget).
same issue on my windows... I am curious why path was not added to the system automatically. I hope this feature can be added to fnm in the future.
I hope this feature can be added to fnm in the future too
The docs in this tool and the Node.js download page can be improved.
The Node.js download page sets the expectation for Windows users that everything will work after you execute these commands:
# Download and install fnm:
winget install Schniz.fnm
# Download and install Node.js:
fnm install 22
# Verify the Node.js version:
node -v # Should print "v22.15.0".
# Verify npm version:
npm -v # Should print "10.9.2".
This is not true.
You will get an error when you execute node —v because such a command is not found in the PATH variable.
fnm expects that you will also configure your shell by adding the execution of fnm env to the PowerShell profile file:
https://github.com/Schniz/fnm?tab=readme-ov-file#shell-setup
Invoke-Item $profile
And next insert:
fnm env --use-on-cd --shell powershell | Out-String | Invoke-Expression
However, this is not mentioned on the Node.js download page. Still, it is described in the second part of the fnm README in the Shell Setup sub-section of the Completions section, which people may not consider a mandatory step and will skip.
Also, many people do not expect to need to set up their shell and expect that environment variables will be set for them on fnm install 22 step. This is the first intuition when you see the Node download page.
Still hard to understand and remember without googling, since most people just never seen those powershell commands Invoke-*.
For someone who don't really need to switch between Node.js versions, using winget is much easier to install Node.js on Windows:
Node.js (Latest Stable):
winget install -e --id=OpenJS.NodeJS
Node.js (LTS):
winget install -e --id=OpenJS.NodeJS.LTS
Automatically works on cmd.exe or powershell.exe.
Though adding a startup script when starting PowerShell works, Cursor cannot detect those envs.
winget install -e --id=OpenJS.NodeJS.LTS Automatically works on cmd.exe or powershell.exe.
This is incredible! Works for me. Really don't even know that this is possible