nodejs.org: fnm download snippet fails on Windows
URL:
https://nodejs.org/en/download
Browser Name:
Microsoft Edge
Browser Version:
133.0.3065.59 (Official build) (64-bit)
Operating System:
Windows 11 24H2 10.0.26100.3037
How to reproduce the issue:
Steps
Copy and run the download instructions from https://nodejs.org/en/download for Windows using fnm with npm in a PowerShell terminal:
# 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.13.1".
# Verify npm version:
npm -v # Should print "10.9.2".
Expectation
The snippet should run without error.
The implicit assumption of offering a “Copy to clipboard” button with a label “PowerShell” is that the shell script can be copied and run as-is.
In fact, a user needs to visit https://github.com/Schniz/fnm/blob/master/README.md and navigate a complex set of instructions to set up fnm to work on Windows.
Actual
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
Install the latest PowerShell for new features and improvements! https://aka.ms/PSWindows
PS C:\Users\mikem> # Download and install fnm:
PS C:\Users\mikem> winget install Schniz.fnm
Found Fast Node Manager [Schniz.fnm] Version 1.38.1
This application is licensed to you by its owner.
Microsoft is not responsible for, nor does it grant any licenses to, third-party packages.
Successfully verified installer hash
Extracting archive...
Successfully extracted archive
Starting package install...
Command line alias added: "fnm"
Successfully installed
PS C:\Users\mikem>
PS C:\Users\mikem> # Download and install Node.js:
PS C:\Users\mikem> fnm install 22
Installing Node v22.13.1 (x64)
PS C:\Users\mikem>
PS C:\Users\mikem> # Verify the Node.js version:
PS C:\Users\mikem> node -v # Should print "v22.13.1".
node : The term 'node' is not recognized as the name of a cmdlet, function, script file, or operable program. Check
the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ node -v # Should print "v22.13.1".
+ ~~~~
+ CategoryInfo : ObjectNotFound: (node:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
PS C:\Users\mikem>
PS C:\Users\mikem> # Verify npm version:
PS C:\Users\mikem> npm -v # Should print "10.9.2".
npm : The term 'npm' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the
spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ npm -v # Should print "10.9.2".
+ ~~~
+ CategoryInfo : ObjectNotFound: (npm:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Related
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 27 (24 by maintainers)
@nodejs/nodejs-website @nodejs/package-maintenance
👍 — Support removing fnm from the Windows installation instructions.
👎 — Oppose removing fnm; prefer to improve the existing instructions.
😕 - Move fnm from an official installation to a community installation; improve the existing instructions.
🚀 - Neutral
❤️ - Reach out to the maintainer of the project for additional insight.
I’m also not in the Windows world, but my gut says the best approach might be to land https://github.com/Schniz/fnm/pull/1018 or some version thereof, so that you have your own install script that folks can run similar to what you recommend for Linux/macOS – that script can then do the full install including the profile, and the winget etc. can remain the “same” as homebrew etc. in just installing the tool itself?
Afaik we are strongly opposed on redirection. We must provide a minimal set of instructions. We of course cannot cover every single terminal app/emulator people are using hence we need to make drawbacks or decide which environment we assume users are. The same applies for Linux. We cant provide support to the whole umbrella of the shell systems out there 😅
I’ll try to merge the PR mentioned next week. I’m currently celebrating Passover with my family but I understand the importance and I do it once I’m back
@avivkeller
Sorry. I somehow missed your post. I will see if I can test your solution.
👋 @Schniz, just checking in on this again to see if there’s any movement and if we can help in any way to get this sorted? If not, I imagine we’re going to have to remove the
fnmrecommendation from the Node.js, which I’d prefer to not do.Heya everyone! As @MattIPv4 said, landing that script (or some variant of) would be ideal. The WinGet installers can be set to execute said script if that’s the direction you are going for, but one way or another, an automated install significantly improves DX
@avivkeller / @ovflowd
If there is any discussion about replacing fnm as a Windows recommendation, that should probably be done under a different issue. (FWIW: I actually use an older version of nvm-windows@1.1.11 for my own daily work.)
This issue should really be focused on getting a working set of instructions to use fnm for Windows.
If there is no automated way to do this for Windows, then perhaps just some extra text would need to be added to the instructions.
Something like:
“# Visit https://github.com/Schniz/fnm for additional setup instructions”
FYI nvm-windows is on maintenance mode and being superseded by https://github.com/coreybutler/nvm-windows/wiki/Runtime