Skip to content

Instantly share code, notes, and snippets.

@satsie
Last active October 8, 2021 17:15
Show Gist options
  • Select an option

  • Save satsie/b6117a06bb5c8f49d6a0d8a362a60200 to your computer and use it in GitHub Desktop.

Select an option

Save satsie/b6117a06bb5c8f49d6a0d8a362a60200 to your computer and use it in GitHub Desktop.
nodejs-notes
How to change versions with `n`:
Check your current Node version: node --version
Install n: sudo npm install -g n
List the available versions of Node 12: n ls-remote 12
Download the latest: sudo n 12.22.1
Sample output:
installing : node-v12.21.0
mkdir : /usr/local/n/versions/node/12.21.0
fetch : https://nodejs.org/dist/v12.21.0/node-v12.21.0-linux-x64.tar.xz
installed : v12.21.0 (with npm 6.14.11)
Note: the node command changed location and the old location may be remembered in your current shell.
old : /usr/bin/node
new : /usr/local/bin/node
To reset the command location hash either start a new shell, or execute PATH="$PATH"
Check the Node version to make sure it worked: node --version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment