Here's a step-by-step guide to installing Node.js, TypeScript, and VS Code on your computer. This guide assumes you're starting from scratch and have no prior installations of these tools. Instructions are provided for both Windows and macOS (with Terminal commands for macOS, assuming you're using the default Terminal app or an equivalent).
Click on the Windows Installer (either the LTS or Current version, depending on your needs. LTS is recommended for stability).
Choose the installer that matches your system architecture (32-bit or 64-bit). If unsure, download the 64-bit version, as most modern systems are 64-bit.
Run the Installer:
Once downloaded, run the .msi file.
Follow the Installation Wizard:
Accept the license agreement.
Choose the installation location (default is usually fine).
Ensure Node.js and npm are installed to a directory in your PATH (this option should be checked by default).
Proceed with the installation.
Once installed, click Finish.
Verify Installation:
Open Command Prompt (Press Win + R, type cmd, and press Enter).
Type node -v and press Enter. You should see the version of Node.js installed.
Type npm -v and press Enter to verify npm (Node Package Manager) installation.
2. Install TypeScript:
Open Command Prompt (if not already open).
Install TypeScript Globally using npm:
Type npm install -g typescript and press Enter.
Wait for the installation to complete.
Verify TypeScript Installation:
Type tsc -v and press Enter. You should see the version of TypeScript installed.
Choose the installer that matches your system architecture (User Installer or System Installer; the difference mainly affects where it's installed and whether it's available to all users or just you).
Run the Installer:
Once downloaded, run the .exe file.
Follow the Installation Wizard:
Accept the agreement.
Choose the installation location (default is usually fine).
Optionally, select to Create a desktop shortcut.
Proceed with the installation.
Once installed, click Finish.
Launch VS Code:
Double-click the desktop shortcut (if created) or find VS Code in your Start menu.
For macOS Users (via Terminal)
1. Install Homebrew (if not already installed)
Before proceeding, ensure you have Homebrew installed. If not, you can install it by running:
Find VS Code in your Applications folder or use Spotlight to open it.
Final Steps for Both Windows and macOS:
Restart your computer to ensure all environment variables are set correctly.
Launch VS Code and start exploring with a new TypeScript project:
File > New Folder (or Ctrl/Cmd + K then Ctrl/Cmd + O) to open a new workspace.
Create a new file named hello.ts, paste in a simple TypeScript snippet, and compile it using the terminal/command prompt with tsc hello.ts to see TypeScript in action.