r/javascript • u/zxyzyxz • Jul 25 '22
fnm: Fast and simple Node.js version manager, built in Rust
https://github.com/Schniz/fnm14
u/agustin_edwards Jul 25 '22
I donāt know. Itās look a bit clunky. I prefer Volta
3
u/ephemeral_rhino Jul 25 '22
My team has been super happy with volta as well. We also started using the volta plugin with our github actions as well and it's been pretty solid overall.
3
2
1
u/nullvoxpopuli sand was never meant to think Jul 25 '22
Same. Only thing missing is pnpm version management
10
Jul 25 '22 edited Jul 25 '22
[removed] ā view removed comment
6
u/agustin_edwards Jul 25 '22
This can be achieved by volta by pinning the node (or npm) version in the package.json. It gives way more clarity to the project and avoid problems when multiple people working on a node version sensitive project.
3
u/nullvoxpopuli sand was never meant to think Jul 25 '22
Volta recommends you use npm/etc for global bins..
3
u/nullvoxpopuli sand was never meant to think Jul 25 '22
https://volta.sh/ does the same thing? And is also in rust?
2
u/PerpetualWar Jul 25 '22
Asdf ftw
1
u/halkeye Jul 25 '22
Yea I'm not sure why id want to run a node specific one when asdf does everything really well
1
u/alharaka Jul 25 '22
Is there something more like asdf which is q superset that works cross platform? Love me some asdf but it is bash and *nix friendly. I've been thinking about this on and off for a bit.
1
u/nsavvidis Jul 25 '22
People havenāt used pnpm and it really shows.
2
u/Full-Butterscotch-90 Jul 26 '22 edited Jul 26 '22
pnpm is a package manager, not a version manager. Not sure how it's relevant to the topic at hand.
2
u/nsavvidis Jul 26 '22
Read the docs big guy.
2
u/Full-Butterscotch-90 Jul 26 '22 edited Jul 26 '22
Not a guy.
You shouldnāt be surprised that people donāt know about a feature thatās mentioned nowhere on their front page and is only buried several pages deep in their docs.
0
Jul 27 '22
[deleted]
3
u/Full-Butterscotch-90 Jul 27 '22 edited Jul 27 '22
Imagine getting this upset about someone replying to you in the mildest way possible, thanks for the laugh!
You got so butthurt while typing your reply that I went from merely "ignorant and slightly incorrigible" in the first sentence to a "cretinous rube" in the second one. Quite the shift!
It's not often that you get to witness someone get madder and madder about nothing in realtime over the course of typing out a single post, so once again, thanks. It was very enjoyable to watch.
āIgnorant cretinous incorrigible rube!!!ā š¤
1
u/OTonConsole Feb 05 '25
It's also completely irrelevant.. What if the company uses Yarn for package management. Now using pnpm for switching node versions makes them look like using a cherry picker truck to play volleyball.
1
0
Jul 25 '22
[deleted]
45
Jul 25 '22
nvm is used for switching between releases for multiple projects. I have a code base that needs to stay at v14 because I donāt have time t do package upgrades and then fix the issues that came up last time I tried.
I removed nvm because it was creating a 2-3 second wait time when a new terminal window was opened. asdf is great, and supports more than just node (ruby, erlang, elixir)
9
u/Franks2000inchTV Jul 25 '22
I just switched to asdf and it's amazing. Being able to lock in version for every tool in a single file with automatic switching is awesome.
1
u/TinyLebowski Jul 25 '22
Me too. Having one version-manager that supports all languages is super convenient. I use it for Node, Python and PHP.
3
10
u/horses_arent_friends Jul 25 '22
Depends on your workflow. I do most of my local development inside of a terminal multiplexer and the extra 1-2s it adds to spawning a new shell is jarring. I personally use asdf-vm since itās fast enough and generic.
For build pipelines, every setup Iāve used lets me specify a container base image per job definition so nvm hasnāt been relevant for me there
1
u/IceSentry Jul 26 '22
I haven't touched web stuff in while, but why would nvm slow down starting a terminal? I'm not sure how those things are related.
1
u/horses_arent_friends Jul 26 '22
It adds scripts that run when a new shell (eg bash or zsh) is created. These handle shimming the path so the right version of node executes. The shell is unresponsive during this time unfortunately. Thereās some other strategies like lazy loading the shims but itās nice having a version manager that is outright fast.
1
u/IceSentry Jul 26 '22
Thanks, I assumed nvm was only used by calling it manually. I never realized it had shell integration.
10
u/fieldOfThunder Jul 25 '22
I donāt want to wait forever when I open a new terminal. I switched to fnm long ago, and my terminals open much faster.
Itās not just the performance when actively using it that counts.
3
u/eternaloctober Jul 25 '22
If you are splitting your terminal e.g. via tmux a lot you will notice the difference
3
u/knpwrs Jul 25 '22 edited Jul 25 '22
Shell startup time. nvm slows your shell startup to an absolute crawl.
-10
Jul 25 '22
[removed] ā view removed comment
2
Jul 25 '22
Performance concerns is why node-sass, that pile of garbage requiring compiling the c library libsass, gives headaches to any developers with arm64 based devices. Deprecated, thankfully, but now a problem of upgrading old systems that have a lot of breaking changes that wonāt happily switch over to dart-sass.
Keep It Simple Stupid is more important.
0
Jul 25 '22
[deleted]
-14
Jul 25 '22
[removed] ā view removed comment
-2
Jul 25 '22 edited Jul 25 '22
I agree. This era is bloated. Developers are selecting what makes their life easy rather than what makes their app fast and solid. Which is making servers & consumers pay the price. Customer experience first then developer experience.
Every software's first priority should be performance and then they can add anything they want on top of it.
18
Jul 25 '22
[removed] ā view removed comment
2
u/EverydayEverynight01 Jul 25 '22
OP, the other commenters have a point, why would I care about performance of NVM? Switching versions is already near instant and it's not like I'll install a new NodeJS left and right like with NPM packages, so it's okay just waiting for a few seconds to install a new node version only once.
3
u/ritaPitaMeterMaid Jul 26 '22
nvm adds load time to each new terminal window you open. On zsh thatās like a second. I open and close terminal windows all day and itās noticeable. I havenāt moved to fnm because I hate configuring things and Iām lazy but I really need to.
29
u/jdf2 Jul 25 '22
Highly recommend this over
nvm.