Hacker News new | ask | show | jobs
by Ezku 2703 days ago
I use nvm currently. Can I ask how this compares to nvm, perhaps issues with nvm that it tackles? Is it performance? :o
5 comments

this really does need a pitch comparison vs nvm. when I first saw yarn I switched almost instantly from npm because the pitch and improvement were clear
Is there still any reason to use yarn today?
we didn't move back since we use lerna with yarn workspaces. few more reasons are offline package cache and pnp

edit: also just read the v2 roadmap that is on the top of HN now - lots of great new features coming up which only reinforces our decision to stick with yarn

Hey! fnm is a very simple and (very) fast node version manager. On my machine, `nvm init`/`nvm use` takes around 600ms - this means each time you spawn a new shell you have a ~600ms penalty.

The gif on the README is real time (it's a screen recording) - so installations are fast, and every command that works locally is extremely fast.

So, tl;dr, fnm is built with performance in mind

Thanks! Perhaps a caption noting this would improve the pitch :)
The problem I have with nvm is speed (running it at shell startup introduces a very noticeable delay), and integration with other shells - it's always been a pain to get it running with fish.
I generally use only a single node version, and therefore don't use the nvm command much, so I've solved the slow shell init by not loading nvm at all, and instead, just set the PATH.

    export PATH=~/.nvm/versions/node/v11.6.0/bin:$PATH
Downside is that you have to bump the version occasionally but it's worth the fast shell startup.
I currently have this problem on my zsh setup - is there any easy fix for it?
idk about zsh, but for fish there is https://github.com/FabioAntunes/fish-nvm which delays executing nvm until you use one of the node binaries. Essentially, node is aliased to `nvm activate && node`
I second this question. I'm using nvm almost everywhere and have never had issues, nor did I ever experience it as slow.
I'm pretty sure `nvm` supports more use cases than fnm right now, as it is a much more mature project. However, it is slower in orders of magnitude.

It does support `.nvmrc` files so my use cases have been fulfilled with fnm - but if yours wasn't implemented yet - you are more than welcome to open an issue and we'll try to tackle it.

Also, fnm is a single executable, therefore it is very easy to install and works across all shells (no need for wrappers in `fish` shells, for instance). Just put it in your path and you're good to go!

I quit using nvm when it has become a pain to run it in non interactive situations such as from cron, from pm2 and from monit config. It needs changes on how it's launched all over and it was just not worth it.
I'm using nave, also with no issues. A "why fnm vs nvim / nave" section in the readme would be useful.