4.1 KiB


The install method in this repo still has its place, but this is no longer maintained.

Update: Use Webi instead:

curl | bash

Easy Install node.js

| A Root Project |

Simple node.js installer for macOS and Linux


curl -fsL | bash

Note: is a redirect to


How to Setup a VPS for node.js Development - (3:06 installing node.js)

Installer Options

  • version
  • install location
  • tools for building native modules

Choose Version

The latest version of node is installed by default.

You can choose a specific version by defining NODE_VERSION in the format vX, vX.Y, or v.X.Y.Z:



export NODE_VERSION=v10.10
curl -fsSL | bash


By default node will be installed to /usr/local, without root if possible.

You can choose a specific location by setting both NPM_CONFIG_PREFIX and NODE_PATH:

export NODE_PATH=$NPM_CONFIG_PREFIX/lib/node_modules
curl -fsSL | bash

If you want to add the install location to your PATH, add /bin to the custom location used above and append it like so:


Development Tools

If you plan on building or creating native node modules, you'll want to install gcc, pgk-config, and a few other required tools and niceties.

In fact, it's fairly common for modules to have both native module and pure js dependencies, so you'll probably want (or need) to install these even if you don't plan to use them directly.

  • curl & wget
  • git
  • rsync
  • xcode, brew (on macOS), build-essential (Linux)
  • gcc, pkg-config
  • pkg-config
  • node.js, jshint

Pass --dev-deps to the installer script and it will use either brew (on macOS) or apt (on Linux) to install the development tools.

curl -fsSL | bash -s -- --dev-deps

Or, if you don't have curl installed yet you can use wget:

wget -nv -O - | bash -s -- --dev-deps

Securing your server

If you're running a node.js server on anything with a public ip address (an "edge" server), I'd highly recommend that you also install fail2ban to secure ssh - especially if you haven't switched your server to use key-only authentication (which you should also do).

See The 15-Minute Guide to Secure VPS Access (for the Semi-Paranoid)


Apple OS X

First you need to Install XCode Command Line Tools

xcode-select --install

Then you need to Accept the XCode License by running any command installed by Xcode with sudo. We'll use git.

sudo git --version

You can scroll to the bottom by hitting shift+G (capital G).

Type agree and hit enter to accept the license.

Now you can install node.js

curl -fsSL -o /tmp/; bash /tmp/ --dev-deps

TODO: Make it easier to accepting the license (automatic?)

Ubuntu Linux

wget -nv -O /tmp/; bash /tmp/ --dev-deps

Automatic Version Detection

Fun FYI, here's how the latest version is determined:

NODE_VERSION=$(curl -fsSL | tail -n +2 | cut -f 1 | head -1 )
echo "The current node.js version is $NODE_VERSION"
NODE_VERSION=$(curl -fsSL | tail -n +2 | cut -f 1 | grep $BASE_VER | head -1 )
echo "Latest node.js $BASE_VER is $NODE_VERSION"