Skip to content
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

Doesn't Work on Windows #1383

Open
MechoJim opened this issue Feb 14, 2025 · 2 comments
Open

Doesn't Work on Windows #1383

MechoJim opened this issue Feb 14, 2025 · 2 comments

Comments

@MechoJim
Copy link

  1. Installed via choco

  2. Manually added fnm path to PATH

  3. Installed node v14 with fnm install v14

When I try to run fnm use v14 is just gives me this error, even in a new shell:

C:\Windows\System32>fnm use v14
←[1;31merror:←[0m ←[31mWe can't find the necessary environment variables to replace the Node version.
You should setup your shell profile to evaluate fnm env, see https://github.com/Schniz/fnm#shell-setup on how to do this
Check out our documentation for more information: https://fnm.vercel.app←[0m

fnm env output:

SET PATH=C:\Users\ADMENG\AppData\Local\fnm_multishells\15068_1739566972562;C:\Python313\Scripts;C:\Python313;C:\Program Files\Semeru\jre-23.0.0.37-openj9\bin;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0;C:\windows\System32\OpenSSH;C:\Program Files\dotnet;C:\ProgramData\chocolatey\bin;C:\Program Files\Git\cmd;C:\Users\ADMENG\AppData\Local\nvm;C:\Program Files\nodejs;C:\Users\ADMENG\AppData\Local\Microsoft\WindowsApps;C:\Users\ADMENG\AppData\Roaming\fnm
SET FNM_MULTISHELL_PATH=C:\Users\ADMENG\AppData\Local\fnm_multishells\15068_1739566972562
SET FNM_VERSION_FILE_STRATEGY=local
SET FNM_DIR=C:\Users\ADMENG\AppData\Roaming\fnm
SET FNM_LOGLEVEL=info
SET FNM_NODE_DIST_MIRROR=https://nodejs.org/dist
SET FNM_COREPACK_ENABLED=false
SET FNM_RESOLVE_ENGINES=true
SET FNM_ARCH=x64

@Aaron7897
Copy link

the docs say to add the following command to the end of your powershell profile (if you're using powershell):

fnm env --use-on-cd --shell powershell | Out-String | Invoke-Expression

the other shell setups are listed there as well: https://github.com/Schniz/fnm?tab=readme-ov-file#shell-setup

@raffaeler
Copy link

@Aaron7897 the point is that the instructions in the https://nodejs.org/en/download home page are wrong because you can't use fnm without tweaking powershell or the cmd first.
And given that I already have my scripts there, it is not straightforward as it looks.
At least for now, this is a no-go.

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

3 participants