From the course: Learning TypeScript

Setting up the development environment - TypeScript Tutorial

From the course: Learning TypeScript

Start my 1-month free trial

Setting up the development environment

- [Instructor] Now let's talk about the tooling you'll need to have in order to develop your applications using TypeScript. The first you'll need is the TypeScript compiler, which you can find at typescriptlang.org. Since TypeScript is a cross-platform development environment, you can use Windows, Mac, or Linux to build your TypeScript applications. I'll be using a Mac to record this course. However, I regularly use TypeScript on Windows in my day job and I actually created the sample application for this course using a Windows machine. So I can guarantee that everything I'm going to show you definitely works in each of the three OS's, right down to the commands we'll be running in the terminal. We'll be using the Node.js instructions shown here. So first you need to open a terminal and check to see if you have Node and NPM installed by running the command npm-v to display the version of NPM you have installed. Notice that I'm running NPM version 6.9.0. If this command failed because Node and NPM are not installed, head on over to nodejs.org and follow the instructions for your operating system. Once you've confirmed that Node and NPM are available, just go back to the TypeScript page, copy this line, and execute it on the terminal. This will install the TypeScript compiler globally, meaning that you can access the compiler in any directory. After a minute, the installation should be successful and you should be able to verify it by running the command tsc. If this command failed, you might want to restart your terminal or consult the Node.js documentation. Finally, I'll be using the Visual Studio Code editor to edit the code I'm showing, which is a fully cross-platform code editor that I highly recommend and since it is cross-platform, you'll be able to mimic exactly every keystroke and click I make regardless of which of the three OS's you're running. If you don't already have VS Code installed, you can head over to code.visualstudio.com and download and run the correct installer for your OS. Also fun fact, VS Code is actually written in TypeScript. Once you test to make sure that you can run the tsc command and that you can edit the files with Visual Studio Code or your favorite text editor, you're all ready to start using TypeScript.

Contents