In this guide, we will install the following development tools
- Visual Studio Code
- node
- npm
- tsc
This course has been tested with the following software versions:
- 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.
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/
-
Follow the link to download Visual Studio Code for MS Windows
-
Run the Installer
-
Follow the steps in the Installer
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 React.
Note: This course has been tested with Node 16.17.0. We will install this version.
-
In your web browser, visit https://nodejs.org/download/release/v16.17.0/
-
Select the Windows Installer (.msi) for your system (32-bit or 64-bit)
-
Run the Installer
-
Follow the steps in the Installer
-
Open a Command Prompt window to verify the node installation
-
In the Command Prompt window, type the following command:
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.
tsc is the TypeScript compiler. We use tsc to compile TypeScript code into JavaScript code. We can install the TypeScript compile using the Node Package Manager (npm)
Note: This course has been tested with TypeScript 4.7. We will install this version.
-
In your Command Prompt 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, node, npm and tsc.
-
If you get the following error when executing tsc command using PowerShell:
tsc : File C:\Users\johndoe\AppData\Roaming\npm\tsc.ps1 cannot be loaded because running scripts is disabled on this system. For more information, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170. At line:1 char:1 + tsc sample-datatypes.ts + ~~~ + CategoryInfo : SecurityError: (:) [], PSSecurityException + FullyQualifiedErrorId : UnauthorizedAccess
-
You can resolve this issue with the following steps:
-
Run Visual Studio Code as Administrator
-
In the Terminal Window of Visual Studio Code, run
Set-ExecutionPolicy RemoteSigned
on PowerShell.
This troubleshooting tip was contributed by Fabio Gomes Sakiyama. Thanks Fabio!!
-
-
If you get the following error when executing tsc command:
Typescript: 'tsc' is not recognized as an internal or external command
-
You can resolve this issue with the following:
- Add the npm installation folder to your "user variables" AND "environment variables"
This troubleshooting tip was contributed by Chris. Thanks Chris!!
© 2022, luv2code LLC - All rights reserved.