Skip to content

Instantly share code, notes, and snippets.

@kazzkiq
Last active September 13, 2018 09:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save kazzkiq/fe702215173e795d49d0c1ffbea363b5 to your computer and use it in GitHub Desktop.
Save kazzkiq/fe702215173e795d49d0c1ffbea363b5 to your computer and use it in GitHub Desktop.
Installing Node.js in 5 minutes: The Final Guide

Installing Node in 5 minutes: The Final Guide.

If you have a shitty internet, it may take a little longer.

First, access Node.js website and click the big green "Download" button.

Download finished? Now run the installation. While the installation goes by, grab yourself a coffee or drink some water, then get back at your chair. By now you should have Node.js and NPM (Node's package manager) installed.

Now, lets install n to manage (and update) Node versions in seconds on your machine. How to install it? Simply run:

npm install -g n

(if you get errors, you probably need administration permissions, try using sudo or equivalent in your OS).

Easy, right? Now, to update your Node.js version, all you have to do is run n latest. And you will have the latest Node.js installed and ready to use in your machine.

To choose which Node.js version you want to use at a given time, run: n and choose between the installed versions.

So, lets recap:

You've installed Node.js via their website for the first time. Then you installed the n package, which lets you have multiple Node versions in the same machine, doing version updates with one line command.

Here is what you've just installed at the end of this tutorial:

Node.js: The V8 JavaScript Engine which will run your JavaScript code locally. Think of it as a JVM (Java).

NPM: Node (JavaScript) package manager. You can think of it as a Maven (Java), Composer (PHP) or Gems (Ruby), but for Node.js.


Updating Node to future versions: Simply run: n latest.

Switching between installed Node versions: Run: n, then select (with arrow keys) which version you want to use. You can check your current node version by running: node -v.

And thats it. Now you've got a minimal environment ready to kick some a*$!

@oscrx
Copy link

oscrx commented Sep 13, 2018

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment