npm Community Forum (Archive)

The npm community forum has been discontinued.

To discuss usage of npm, visit the GitHub Support Community.

nvh: Node Version Helper

I have published @shadowspawn/nvh to easily install node versions on Mac and Linux.

nvh does simple installs to destination, no shims or symlinks or per version cleverness. (As per n which nvh was forked from.)

Simple familiar syntax, and version shorthands:

nvh install 10.14.3
nvh install lts
nvh i current
nvh i 8

Menu selection of already downloaded versions to reinstall. Runtime detection of some setup problems, and nvh doctor for deeper diagnostics.

Of interest to this forum for staying on npm@latest and preserving npm while changing node versions:

nvh install --preserve lts
# or make that the default behaviour

Of interest for the adventurous working with pre-release node versions:

nvh install nightly
nvh install test/v11.0.0-test20180527
nvh install rc/10

See the home page for all the details.

How does this package differ from n and nvm?

n and nvh are changing the version of node by reinstalling node. Global npm installs (other than npm itself) are not changed.

My understanding is nvm is managing independent installs of node+npm. The npm global packages can be different between node versions. Changing node versions is not an install as such (so fast). You can be using different versions of node in different shells.

As for n vs nvh, nvh is forked from n so started from the same code. Still the same big picture approach, lots of differences in the details. I have made some big improvements to the visibility of errors, fixed quite a few bugs reported against n, extended the syntax for specifying target version, reworked the CLI to be more consistent with other commands, and added some features.

See the changelog for all the changes since the fork:

I like the idea, I’ll give it a try. Thanks @shadowspawn!

Interesting, I’m definitely using this the next time I fresh-install Node in a machine (and take one more star for your repo).