Introducing MEVN Chapter 1
Installing Node.js on Linux
For Linux, we can either install the default distribution of Node.js or we can download it
from NodeSource to use the latest version.
Installing Node.js from the default distribution
To install from the default distribution, we can install Node.js on Linux by using this
command:
$ sudo apt-get install -y nodejs
Installing Node.js from NodeSource
To install Node.js from NodeSource, perform the following steps:
- First download the latest version of Node.js from NodeSource:
$ curl -sL https://deb.nodesource.com/setup_9.x | sudo -E bash
- Then, install Node.js with the command:
$ sudo apt-get install -y nodejs
The apt is a short form of Advanced Package Tool that is used to install
software on Debian and Linux distributions. Basically, this is equivalent to
the Homebrew command in macOS.
Installing Node.js on Windows
We can install Node.js on Windows by following these steps:
- Download the Node.js installer from the official website (https://nodejs.org/
en/download/). - Run the installer and follow the given instructions.
- Click on the Close/Finish button.