Skip to content

Instantly share code, notes, and snippets.

@imasif
Last active September 12, 2019 06:52
Show Gist options
  • Save imasif/6a24f8d37b7d73feaa6f3c96c6bbcd61 to your computer and use it in GitHub Desktop.
Save imasif/6a24f8d37b7d73feaa6f3c96c6bbcd61 to your computer and use it in GitHub Desktop.
NodeJS multiple version management Linux/Mac
1. We will be using 'n' for it. But before using `n` we need to install make;
$ sudo apt-get install make
2. Installing `n`:
$ curl -L https://git.io/n-install | bash
sets both PREFIX and N_PREFIX to $HOME/n, installs n to $HOME/n/bin,
modifies the initialization files of supported shells to export N_PREFIX and add $HOME/n/bin to the PATH,
and installs the latest stable node version.
3. . ~/.bashrc (reload .bashrc file)
##for mac it's simple:
Since you probably already have node, the easiest way to install n is through npm:
$ npm install -g n
Everything else can be found here:
https://github.com/tj/n#installingactivating-versions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment