DEV Community


Introducing nodevirtualenv - a pure bash n+virtualenv clone

techiev2 profile image Sriram Velamur Originally published at ・1 min read


A virtualenv clone for NodeJS. Provides a flow that borrows from the convenience of both n and virtualenv


At crisp, NodeJS powers our article content extraction services. A cause of concern during development/ deployment has been version maintenance. With containers, smaller team bandwidths meant high maintenance costs.

Currently, n powers most of our NodeJS versioning requirements. It has been convenient for the most part since it installs a non-intrusive binary at /usr/local. The missing part with n was with a single version's use between two packages with different needs.

A virtualenv kind of solution would be an ideal solution for these cases. While nodeenv exists, the activate flow, pip install (as the primary mode) added load to picking it up.

Ergo, nodevirtualenv comes in as an alternative.


In its current state, nodevirtualenv allows installation of specific NodeJS versions inside $HOME/.node-envs/

    nodevirtualenv -v <version> -p <envPath>

      -v        NodeJS version to install/use to run.
      -p        NodeJS installation path to use.
      -c        Script path to run with the requested version.

      --bin     Get the path for the NodeJS binary for the version specified.
      --list    List all locally installed NodeJS versions.

Caveat emptor

  • As such, the script works only on 64-bit GNU/Linux systems and uses the corresponding binary paths from NodeJS distribution channels. Support for Windows/non-GNU/Linux systems are forthcoming.

Discussion (1)

Editor guide
chrispardy profile image

You should checkout NVM