-
Book Overview & Buying
-
Table Of Contents
Full Stack Development with Angular and GraphQL
By :
We'll need to install Node.js after installing the MySQL database management system because it's necessary for executing our server code.
We have several options for installing Node.js on our operating system:
As previously said, we will presume you are running a Debian-based system such as Ubuntu. In this chapter, we'll teach you how to use the first method on an Ubuntu system.
Important Note
If you are not using an Ubuntu or Debian-based system, go to the official website at https://nodejs.org/en/download/package-manager/ and get the necessary instructions to install Node.js on your operating system.
You can install Node.js and npm using nvm instead of your system's native package manager. This utility does not operate at the system level. Instead, it makes use of a distinct folder in your home directory.
This allows you to install several versions of Node.js at the same time and quickly switch between them as needed. In addition, after you've installed nvm, you can quickly install any version of Node.js, old or new, with a single command.
Let's go over the steps:
curl -sL https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh
bash install.sh
This command will clone the nvm repository under the ~/.nvm folder and update the ~/.profile file as necessary.
source ~/.profile
nvm ls-remote
v12.22.1 in this book, which you can install using the following command: nvm install v12.22.1
This will download the installation binary that is compatible with your operating system and install Node.js together with npm. It will also make this version the default version.
node –v
In our case, we get v12.22.1 printed on the Terminal.
More information on the available commands and how to use them may be found in the official repository at https://github.com/nvm-sh/nvm.
The nvm utility is compatible with Linux, macOS, and Windows Subsystem for Linux (WSL). You may use two unofficial alternatives for Windows:
That's everything – you've configured your development machine to run Node.js, allowing you to install and use Node.js packages such as Express.js to build your backend application, as well as frontend libraries and tools such as Angular CLI.
We'll use npm to install the dependencies for our backend and frontend apps throughout this book.