Nodenv
Manage multiple NodeJS versions.
Understanding Shims
nodenv works by inserting a directory of shims at the front of your PATH
:
Through a process called rehashing, nodenv maintains shims in that directory to match every Node command across every installed version of Node—node, npm, and so on.
Shims are lightweight executables that simply pass your command along to nodenv. So with nodenv installed, when you run, say, npm, your operating system will do the following:
- Search your
PATH
for an executable file named npm - Find the nodenv shim named npm at the beginning of your
PATH
- Run the shim named npm, which in turn passes the command along to nodenv