nvh: Node Version Helper

(John Gee) #1

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.

Unhandled rejection Error: EISDIR: illegal operation on a directory, open '/Users/me/.npm/_cacache/tmp'
npm install error on resolving ionic 3 project error
(A Lloyd Flanagan) #2

How does this package differ from n and nvm?

(John Gee) #3

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: https://github.com/shadowspawn/nvh/blob/master/CHANGELOG.md

(Frédéric Harper) #4

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