In this guide, we will install the following development tools
- Visual Studio Code
- nvm
- npm
- node
- tsc
This course has been tested with the following software versions:
- nvm 0.35.0
- npm 8.15
- node 16.17.0
- tsc 4.7.4
- React 18.2.0
- Spring Boot 2.7.3
It is highly recommended that you use the versions listed above to make sure you do not encounter any issues with the course. If you choose to use other versions then the code may not work as expected.
-
git: You must have the git command-line tool installed.
- To install git, visit: https://git-scm.com/
Visual Studio Code is a general purpose IDE that support many programming languages. Visual Studio code has built-in support for TypeScript.
-
In a web browser, visit https://code.visualstudio.com/
-
Click the link to download Visual Studio Code for Linux
-
Follow the installation instructions for your Linux distribution.
nvm is the Node Version Manager. It allows you to install multiple versions of Node on your computer. Once installed, then you can easily switch to a different version of Node. This is very useful if you want to develop/test using different versions of Node. When you are developing multiple projects, you will most likely need to support different versions of Node.
The best feature of nvm is that it makes the installation of Node very easy for Mac and Linux system. Historically, to install Node on Mac/Linux, you would have to make frequent use of the "sudo" command to elevate privileges. This was a painful and clunky process during development. Thanks the nvm, we no longer have to use "sudo" when using Node.
Also, the Node ecosystem is a fast moving target and versions change frequently. nvm makes it easy to stay up to date with the latest version of Node.
The website for nvm is: https://github.com/nvm-sh/nvm
Note: You must have git installed before running this script.
-
Open a new terminal window
-
Enter the following commands:
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.35.0/install.sh | bash
The script clones the nvm repository to
/.nvm and adds the source line to your profile (/.bash_profile, ~/.zshrc, ~/.profile, or ~/.bashrc).You will see output similar to the following:
% Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 13527 100 13527 0 0 62065 0 --:--:-- --:--:-- --:--:-- 62336 => Downloading nvm from git to '/home/luv2code/.nvm' => Cloning into '/home/luv2code/.nvm'... remote: Enumerating objects: 286, done. ... => Appending nvm source string to /home/luv2code/.bashrc => Appending bash_completion source string to /home/luv2code/.bashrc => Close and reopen your terminal to start using nvm or run the following to use it now: ...
-
Apply the new PATH settings with:
source ~/.bashrc
-
Verify the installation, by typing the following command:
nvm --version
If the installation is successful, you will see the version number.
For details on other nvm commands, use
nvm --help
or see the docs: https://github.com/nvm-sh/nvm
Node is the the runtime environment for executing JavaScript code from the command-line. By using Node, you can create any type of application using JavaScript including server-side / backend applications.
In this course, we'll use Node to run applications that we develop using TypeScript and Angular.
-
In your terminal window, type the following command:
nvm install node
You will see the following output
Downloading and installing node v18.4.0... Downloading https://nodejs.org/dist/v18.4.0/node-v18.4.0-... ######################################################################## 100.0% Computing checksum with shasum -a 256 Checksums matched! Now using node v18.4.0 (npm v8.12.1) Creating default alias: default -> node (-> v18.4.0)
-
Verify the node installation
node --version
If the installation is successful, you will see the version number
Note: The Node installation also includes npm (Node Package Manager).
-
Verify npm is installed
npm --version
If the installation is successful, you will see the version number.
Note: node will have a different number than npm. This is similar to a different Java JDK version number compared to Maven version number.
In this example, node is similar to the Java JDK. And npm is similar to Maven.
Note: This course has been tested with Node 16.17. We will install this version.
-
Install and use Node 16.17
nvm install 16.17.0 nvm use 16.17.0
tsc is the TypeScript compiler. We use tsc to compile TypeScript code into JavaScript code. We can install the TypeScript compiler using the Node Package Manager (npm)
Note: This course has been tested with TypeScript 4.7. We will install this version.
-
In your terminal window, enter the following command
npm install --location=global typescript@4.7.4
The
--location=global
installs this as a global package. The TypeScript compiler will be available to all directories for this user. -
You can verify the installation
tsc --version
If the installation is successful, you will see the version number.
That's it! You have successfully installed the development tools: Visual Studio Code, nvm, node, npm and tsc.
© 2022, luv2code LLC - All rights reserved.