Skip to content

Windows install did not add PATH environment after installed node. #1410

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
amnuaym opened this issue Apr 8, 2025 · 9 comments
Open

Windows install did not add PATH environment after installed node. #1410

amnuaym opened this issue Apr 8, 2025 · 9 comments

Comments

@amnuaym
Copy link

amnuaym commented Apr 8, 2025

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

@alex-vovk-info
Copy link

@MattIPv4
Copy link

👋 @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).

@oliverance
Copy link

oliverance commented Apr 23, 2025

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.

@a-touch-of-watermelon
Copy link

I hope this feature can be added to fnm in the future too

@RainerZufall187
Copy link

@Berehulia
Copy link

Berehulia commented May 10, 2025

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.

@louislam
Copy link

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.

@oxygenkun
Copy link

Though adding a startup script when starting PowerShell works, Cursor cannot detect those envs.

@psoloviov
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants