

{"id":112703,"date":"2023-03-24T09:00:10","date_gmt":"2023-03-24T03:30:10","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=112703"},"modified":"2023-03-24T14:48:15","modified_gmt":"2023-03-24T09:18:15","slug":"typescript-installation","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/typescript-installation\/","title":{"rendered":"TypeScript Installation and Environment Setup"},"content":{"rendered":"<p>A well-liked programming language for creating complicated, large-scale applications is TypeScript. It supersets JavaScript and is an object-oriented, strongly typed language. Several capabilities offered in TypeScript are unavailable in JavaScript, including static typing, interfaces, classes, etc. You can follow the instructions in this article to set up a TypeScript development environment.<\/p>\n<h3>Steps to install TypeScript<\/h3>\n<h4>1. Install Node.js<\/h4>\n<p>The first step in setting up a TypeScript development environment is to install Node.js. Node.js is a JavaScript runtime that allows us to execute JavaScript code outside the browser. It is a crucial component of many modern web applications and is required for TypeScript development.<\/p>\n<p>You need to <a href=\"https:\/\/nodejs.org\/en\/download\/\">download Node.js<\/a> to install it. After downloading the installer, complete the installation by adhering to the instructions.<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/03\/nodejs.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-113003\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/03\/nodejs.webp\" alt=\"nodejs\" width=\"1920\" height=\"960\" \/><\/a><\/p>\n<ul>\n<li><strong>For Linux<\/strong> &#8211; Install using terminal by the command \u2018sudo apt install nodejs\u2019<\/li>\n<li><strong>For Windows<\/strong> &#8211; Install the exe file by clicking it and running the executable file.<\/li>\n<li><strong>For Mac<\/strong> &#8211; Download Node.js for macOS by clicking the &#8220;Macintosh Installer&#8221; option and run the downloaded Node.js .pkg Installer<\/li>\n<\/ul>\n<h4>2. Install TypeScript<\/h4>\n<p>Once you have installed Node.js, the next step is to install TypeScript. TypeScript can be installed using the Node Package Manager (npm). To install TypeScript, open a terminal or command prompt and run the following command:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">\u2018npm install -g typescript\u2019 \r\n<\/pre>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/03\/install-typescript.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-113004\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/03\/install-typescript.webp\" alt=\"install typescript\" width=\"729\" height=\"435\" \/><\/a><\/p>\n<p>With this command, TypeScript will be installed system-wide. The package is installed globally for use from any directory when the -g flag is used by npm.<\/p>\n<p><strong>For Mac<\/strong><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/03\/nodejs-macos-installation.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-113005\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/03\/nodejs-macos-installation.webp\" alt=\"nodejs macos installation\" width=\"1256\" height=\"886\" \/><\/a><\/p>\n<p>Install using &#8220;Macintosh Installer&#8221; and run the downloaded \u201c.pkg\u201d file to install NodeJS.<\/p>\n<h3>Installing TypeScript using Visual Studio Code<\/h3>\n<p>Visual Studio is a popular integrated development environment (IDE) that supports multiple programming languages, including TypeScript. To install TypeScript using the Visual Studio extension, follow the steps below:<\/p>\n<p><strong>Step 1: Install Visual Studio<\/strong><\/p>\n<p>You can <a href=\"https:\/\/code.visualstudio.com\/\">download Visual Studio<\/a> from the official Visual Studio website if you still need to install it on your system. Make sure to download and install the version that supports TypeScript.<\/p>\n<p><strong>Step 2: Install TypeScript Extension<\/strong><\/p>\n<p>Once you have installed Visual Studio, you can install the TypeScript extension from the Visual Studio Marketplace. To do this, follow the steps below:<\/p>\n<p>1. Open Visual Studio and click on the &#8220;Extensions&#8221; menu item from the top menu bar.<br \/>\n2. Click on &#8220;Manage Extensions.&#8221;<br \/>\n3. In the &#8220;Extensions and Updates&#8221; dialog box, click &#8220;Online&#8221; from the left side menu.<br \/>\n4. Search for &#8220;TypeScript&#8221; in the search box and press enter.<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/03\/typescript-extension-vs-code.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-113007\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/03\/typescript-extension-vs-code.webp\" alt=\"typescript extension vs code\" width=\"1854\" height=\"911\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>5. From the search results, select the TypeScript extension and click on the &#8220;Download&#8221; button.<br \/>\n6. Once the download is complete, click on the &#8220;Install&#8221; button.<br \/>\n7. Follow the prompts to complete the installation process.<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/03\/install-typescript-extension-vs-code.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-113006\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/03\/install-typescript-extension-vs-code.webp\" alt=\"install typescript extension vs code\" width=\"1866\" height=\"903\" \/><\/a><\/p>\n<p><strong>Step 3: Create a TypeScript project<\/strong><\/p>\n<p>After installing the TypeScript extension, you can create a new TypeScript project. To do this, follow the steps below:<\/p>\n<p>a. Create a new folder called \u2018DataFlair Project\u2019<\/p>\n<p>b. Create a new file called \u2018app.ts\u2019<\/p>\n<p>c. Write the following code.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">console.log('Hello, World');\r\n<\/pre>\n<p>d. Run the app using the play button on top right corner.<\/p>\n<p>&nbsp;<\/p>\n<p>e. You will get the following output.<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/03\/output-of-the-code-in-vs-code.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-113009\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/03\/output-of-the-code-in-vs-code.webp\" alt=\"output of the code in vs code\" width=\"886\" height=\"160\" \/><\/a><\/p>\n<h4>3. Creating a TypeScript Project<\/h4>\n<p>We must build a new directory and start it as a Node.js project before creating a new TypeScript project.<\/p>\n<p>To accomplish this, launch a terminal or command prompt and go to the directory where the project will be created. Run the subsequent commands after that:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">\u2018mkdir DataFlair-project\u2019\r\n\u2018cd DataFlair-project\u2019\r\n\u2018npm init -y\u2019\r\n<\/pre>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/03\/npm-init.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-113010\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/03\/npm-init.webp\" alt=\"npm init\" width=\"715\" height=\"420\" \/><\/a><\/p>\n<p>The first command creates a new directory called DataFlair-project. The second command navigates into the new directory. The third command initializes the directory as a Node.js project and creates a package.json file.<\/p>\n<p>The -y flag tells npm to use the default settings and not ask questions.<\/p>\n<h4>4. Configuring TypeScript<\/h4>\n<p>We need to configure TypeScript for our project now that a new project has been created and TypeScript has been installed. To accomplish this, a tsconfig.json file must be created in the root of our project directory. The TypeScript configuration options are located in this file.<\/p>\n<p>To create the tsconfig.json file, run the following command:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">\u2018tsc --init\u2019\r\n<\/pre>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/03\/typescript-init.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-113011\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/03\/typescript-init.webp\" alt=\"typescript init\" width=\"733\" height=\"420\" \/><\/a><\/p>\n<p>This command will create a new tsconfig.json file in the root of our project directory. The tsconfig.json file contains many configuration options, but we only need to change a few.<\/p>\n<p>The first option we need to change is the target option. This option specifies the ECMAScript version that TypeScript will compile our code to. We will set this option to ES2018 to target the latest version of ECMAScript.<\/p>\n<p>The second option we need to change is the outDir option. This option specifies the directory where the compiled TypeScript files will be placed. We will set this option to dist to create a new directory called dist in the root of our project directory.<\/p>\n<p>Here is what our tsconfig.json file should look like:<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/03\/tsconfig-file.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-113012\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/03\/tsconfig-file.webp\" alt=\"tsconfig file\" width=\"742\" height=\"336\" \/><\/a><\/p>\n<h4>5. Writing TypeScript Code<\/h4>\n<p>Now that we have set up our TypeScript development environment, we can start writing TypeScript code. To create a new TypeScript file, create a new file with a .ts extension in the root of our project directory. For example, create a new file called index.ts.<\/p>\n<p>In our index.ts file, we can write TypeScript code just like JavaScript code. However, we can take advantage of the additional features that TypeScript provides, such as static typing, interfaces, and classes.<\/p>\n<p>For example, let&#8217;s create a simple function that adds two numbers together and returns the result. We will define the types for the function parameters and return values using TypeScript&#8217;s static typing:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">function DataFlair_addNumbers(num1: number, num2: number): number {\r\n return num1 + num2;\r\n}\r\n\r\n\r\nconsole.log(DataFlair_addNumbers(5, 10));\r\n<\/pre>\n<p>In this example, we have defined a function called DataFlair_addNumbers that takes two parameters of the type number and returns a value of the type number. We have also used TypeScript&#8217;s static typing to ensure that the function is only called with the correct types of parameters.<\/p>\n<h4>6. Compiling TypeScript Code<\/h4>\n<p>Once we have written our TypeScript code, we must compile it to JavaScript to be executed in a web browser or a Node.js environment. To compile our TypeScript code, we can use the tsc command.<\/p>\n<p>To compile our TypeScript code, open a terminal or command prompt and navigate to the root of our project directory. Then, run the following command:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">\u2018tsc\u2019<\/pre>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/03\/typescript-compiling.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-113013\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/03\/typescript-compiling.webp\" alt=\"typescript compiling\" width=\"611\" height=\"124\" \/><\/a><\/p>\n<p>This command will compile all the TypeScript files in our project directory and place the compiled JavaScript files in the dist directory, as specified in our tsconfig.json file.<\/p>\n<h4>7. Running TypeScript Code<\/h4>\n<p>Now that we have compiled our TypeScript code into JavaScript, we can run it in a web browser or a Node.js environment. To run our code in a web browser, we must create an HTML file referencing our compiled JavaScript file.<\/p>\n<p>In the root of our project directory, create a new file called index.html, and add the following code:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">&lt;!DOCTYPE html&gt;\r\n&lt;html lang=\"en\"&gt;\r\n &lt;head&gt;\r\n   &lt;title&gt;DataFlair TypeScript Example&lt;\/title&gt;\r\n &lt;\/head&gt;\r\n &lt;body&gt;\r\n   &lt;script src=\".\/index.ts\"&gt;&lt;\/script&gt;\r\n &lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<p>This HTML file references our compiled JavaScript file located in the dist directory.<\/p>\n<p>We may use the node command to run our code in a Node.js environment. Open a terminal or command prompt, go to the root of our project directory, and run our index.js file from there. Run the subsequent command after that:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">\u2018node index.js\u2019\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/03\/running-js-file.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-113015\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/03\/running-js-file.webp\" alt=\"running js file\" width=\"606\" height=\"129\" \/><\/a><\/p>\n<p>This command will execute our index.js file in a Node.js environment.<\/p>\n<h3>Installing ts-node<\/h3>\n<p>ts-node is a TypeScript execution engine that allows you to run TypeScript code directly without compiling it first. It is a popular tool among TypeScript developers, making it easy to write and test TypeScript code quickly without the extra compilation step.<\/p>\n<p>Here are the steps to install ts-node:<\/p>\n<h4>1. Install Node.js:<\/h4>\n<p>ts-node requires Node.js to be installed on your computer. You can download and install the latest version of Node.js from the official website: https:\/\/nodejs.org\/en\/download\/.<\/p>\n<h4>2. Install ts-node:<\/h4>\n<p>Once you have Node.js installed, you can install ts-node by running the following command in your terminal or command prompt:<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/03\/install-ts-node.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-113016\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/03\/install-ts-node.webp\" alt=\"install ts node\" width=\"675\" height=\"219\" \/><\/a><\/p>\n<p>This will install ts-node globally on your computer.<\/p>\n<h4>3. Verify installation:<\/h4>\n<p>To verify that ts-node is installed correctly, you can run the following command in your terminal or command prompt:<a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/03\/check-ts-node-version.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-113017\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/03\/check-ts-node-version.webp\" alt=\"check ts node version\" width=\"729\" height=\"396\" \/><\/a><\/p>\n<p>This should output the version number of ts-node that you have installed.<\/p>\n<p>Once you have ts-node installed, you can use it to run TypeScript code directly from the command line. For example, if you have a file named app.ts that contains some TypeScript code, you can run it using ts-node like this:<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/03\/run-file-using-ts-node.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-113018\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/03\/run-file-using-ts-node.webp\" alt=\"run file using ts node\" width=\"733\" height=\"387\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>This will execute the TypeScript code in app.ts without compiling it first.<\/p>\n<p>Note that ts-node is intended for development and testing and is not recommended for use in production environments. Compiling your TypeScript code to JavaScript before deploying it to production is best.<\/p>\n<h3>Conclusion<\/h3>\n<p>In this article, we have walked you through the steps to set up a TypeScript development environment. We have installed Node.js, installed TypeScript using npm, created a new TypeScript project, configured TypeScript for our project, written TypeScript code, compiled our TypeScript code to JavaScript, and run our code in a web browser and a Node.js environment.<\/p>\n<p>TypeScript is a powerful programming language that offers many features unavailable in JavaScript. Setting up a TypeScript development environment allows you to easily take advantage of these features and build large-scale, complex applications.<span hidden class=\"__iawmlf-post-loop-links\" data-iawmlf-links=\"[{&quot;id&quot;:143,&quot;href&quot;:&quot;https:\\\/\\\/nodejs.org\\\/en\\\/download&quot;,&quot;archived_href&quot;:&quot;http:\\\/\\\/web-wp.archive.org\\\/web\\\/20251205112253\\\/https:\\\/\\\/nodejs.org\\\/en\\\/download&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[{&quot;date&quot;:&quot;2025-12-06 11:28:32&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2025-12-09 21:29:54&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2025-12-22 02:11:04&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2025-12-28 15:00:09&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-01-03 10:07:42&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-01-16 04:01:55&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-01-20 17:52:34&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-06 11:03:20&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-10 03:59:23&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-14 01:32:55&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-20 11:45:55&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-24 04:00:38&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-05 05:22:58&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-20 17:34:53&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-04-04 06:52:10&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-04-11 18:37:35&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-04-15 22:30:20&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-04-21 00:30:01&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-04-24 13:23:31&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-05-03 14:29:09&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-05-07 13:07:28&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-05-14 06:40:04&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-05-20 18:26:35&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-05-27 23:06:55&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-06-03 07:31:36&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-06-10 18:01:37&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-06-15 18:33:20&quot;,&quot;http_code&quot;:503}],&quot;broken&quot;:false,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-06-15 18:33:20&quot;,&quot;http_code&quot;:503},&quot;process&quot;:&quot;done&quot;},{&quot;id&quot;:123,&quot;href&quot;:&quot;https:\\\/\\\/code.visualstudio.com&quot;,&quot;archived_href&quot;:&quot;http:\\\/\\\/web-wp.archive.org\\\/web\\\/20251205214209\\\/https:\\\/\\\/code.visualstudio.com\\\/&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[{&quot;date&quot;:&quot;2025-12-05 23:43:05&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2025-12-09 10:52:25&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2025-12-12 17:09:16&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2025-12-16 05:56:23&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2025-12-19 07:25:52&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2025-12-22 20:58:37&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2025-12-28 15:00:10&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-03 05:38:33&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-06 23:45:24&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-10 14:37:45&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-14 20:15:37&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-18 06:33:19&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-21 06:54:49&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-25 11:39:53&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-29 20:08:41&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-02 10:35:55&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-09 13:40:23&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-13 20:55:47&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-17 08:20:00&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-20 14:37:00&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-24 04:00:40&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-27 14:30:29&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-02 21:06:25&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-06 18:40:54&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-12 20:13:42&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-19 08:50:26&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-22 09:49:47&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-25 15:20:24&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-31 15:07:00&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-03 22:39:10&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-07 17:20:55&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-11 12:41:41&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-16 05:14:14&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-19 11:49:52&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-04-23 00:20:41&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-26 05:25:30&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-29 10:47:28&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-05-04 11:49:38&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-05-08 10:42:18&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-05-12 05:00:55&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-05-15 19:19:44&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-05-19 07:58:48&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-05-22 10:56:46&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-05-25 12:27:52&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-05-29 19:47:28&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-06-01 22:12:05&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-06-05 07:11:42&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-06-09 06:26:39&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-06-15 21:58:48&quot;,&quot;http_code&quot;:206}],&quot;broken&quot;:false,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-06-15 21:58:48&quot;,&quot;http_code&quot;:206},&quot;process&quot;:&quot;done&quot;}]\"><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>A well-liked programming language for creating complicated, large-scale applications is TypeScript. It supersets JavaScript and is an object-oriented, strongly typed language. Several capabilities offered in TypeScript are unavailable in JavaScript, including static typing, interfaces,&#46;&#46;&#46;<\/p>\n","protected":false},"author":581,"featured_media":112930,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[27319],"tags":[27339,27338],"class_list":["post-112703","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-typescript-tutorials","tag-typescript-environment-setup","tag-typescript-installation"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>TypeScript Installation and Environment Setup - DataFlair<\/title>\n<meta name=\"description\" content=\"See the steps to set up a TypeScript development environment. Learn the various steps required for typescript installation.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/data-flair.training\/blogs\/typescript-installation\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"TypeScript Installation and Environment Setup - DataFlair\" \/>\n<meta property=\"og:description\" content=\"See the steps to set up a TypeScript development environment. Learn the various steps required for typescript installation.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/typescript-installation\/\" \/>\n<meta property=\"og:site_name\" content=\"DataFlair\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/DataFlairWS\/\" \/>\n<meta property=\"article:published_time\" content=\"2023-03-24T03:30:10+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-03-24T09:18:15+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/03\/typescript-environment-setup.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"DataFlair Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:site\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"DataFlair Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"10 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"TypeScript Installation and Environment Setup - DataFlair","description":"See the steps to set up a TypeScript development environment. Learn the various steps required for typescript installation.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/data-flair.training\/blogs\/typescript-installation\/","og_locale":"en_US","og_type":"article","og_title":"TypeScript Installation and Environment Setup - DataFlair","og_description":"See the steps to set up a TypeScript development environment. Learn the various steps required for typescript installation.","og_url":"https:\/\/data-flair.training\/blogs\/typescript-installation\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2023-03-24T03:30:10+00:00","article_modified_time":"2023-03-24T09:18:15+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/03\/typescript-environment-setup.webp","type":"image\/webp"}],"author":"DataFlair Team","twitter_card":"summary_large_image","twitter_creator":"@DataFlairWS","twitter_site":"@DataFlairWS","twitter_misc":{"Written by":"DataFlair Team","Est. reading time":"10 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/typescript-installation\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/typescript-installation\/"},"author":{"name":"DataFlair Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/c187795dc82ab948373cca526df7c445"},"headline":"TypeScript Installation and Environment Setup","datePublished":"2023-03-24T03:30:10+00:00","dateModified":"2023-03-24T09:18:15+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/typescript-installation\/"},"wordCount":1499,"commentCount":0,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/typescript-installation\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/03\/typescript-environment-setup.webp","keywords":["typescript Environment Setup","TypeScript Installation"],"articleSection":["TypeScript Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/typescript-installation\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/typescript-installation\/","url":"https:\/\/data-flair.training\/blogs\/typescript-installation\/","name":"TypeScript Installation and Environment Setup - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/typescript-installation\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/typescript-installation\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/03\/typescript-environment-setup.webp","datePublished":"2023-03-24T03:30:10+00:00","dateModified":"2023-03-24T09:18:15+00:00","description":"See the steps to set up a TypeScript development environment. Learn the various steps required for typescript installation.","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/typescript-installation\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/typescript-installation\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/typescript-installation\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/03\/typescript-environment-setup.webp","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/03\/typescript-environment-setup.webp","width":1200,"height":628,"caption":"typescript environment setup"},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/typescript-installation\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog Home","item":"https:\/\/data-flair.training\/blogs\/"},{"@type":"ListItem","position":2,"name":"TypeScript Tutorials","item":"https:\/\/data-flair.training\/blogs\/category\/typescript-tutorials\/"},{"@type":"ListItem","position":3,"name":"TypeScript Installation and Environment Setup"}]},{"@type":"WebSite","@id":"https:\/\/data-flair.training\/blogs\/#website","url":"https:\/\/data-flair.training\/blogs\/","name":"DataFlair","description":"Learn Today. Lead Tomorrow.","publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/data-flair.training\/blogs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/data-flair.training\/blogs\/#organization","name":"DataFlair","url":"https:\/\/data-flair.training\/blogs\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","width":106,"height":48,"caption":"DataFlair"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/DataFlairWS\/","https:\/\/x.com\/DataFlairWS","https:\/\/www.linkedin.com\/company\/dataflair-web-services-pvt-ltd\/","https:\/\/www.youtube.com\/user\/DataFlairWS"]},{"@type":"Person","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/c187795dc82ab948373cca526df7c445","name":"DataFlair Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/2302ebc438084d2f1f993edc1996a0aae01332e81f3227cba8df0c48ec010ca4?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/2302ebc438084d2f1f993edc1996a0aae01332e81f3227cba8df0c48ec010ca4?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/2302ebc438084d2f1f993edc1996a0aae01332e81f3227cba8df0c48ec010ca4?s=96&d=mm&r=g","caption":"DataFlair Team"},"description":"DataFlair Team provides high-impact content on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. We make complex concepts easy to grasp, helping learners of all levels succeed in their tech careers.","url":"https:\/\/data-flair.training\/blogs\/author\/dfteam6\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/112703","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/users\/581"}],"replies":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/comments?post=112703"}],"version-history":[{"count":6,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/112703\/revisions"}],"predecessor-version":[{"id":113396,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/112703\/revisions\/113396"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/112930"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=112703"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=112703"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=112703"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}