TypeScript environment installation and configuration of idea development environment

  Preparation Before Installation

 

  Npm install typescript need to use management tools, along with Node.js and npm package management tool is installed together, so we have installed Node

  1, to the Node official website to download the latest version of the installation package: http://nodejs.cn/download/ , double-click operation

  2. Select the installation mode when we chose only  npm package manager  on it, installed after the open cmd, input node -v, npm -v to check the version number

    

   The version number corresponding installation instructions Node success happens, we just installed a management tool npm

 

   start installation

 

  After installing the tool npm open cmd, using npm install - G typescript  command to install typescript     

  After more than seven hundred seconds ...

   Use  tsc -v  command to check the version number

   Display the corresponding version number of the installation is successful

 

  Configuring idea

 

  Open setting, set Languages ​​& Frameworks> TypeScript

  Node interpreter, choose our path just installed node following node.exe

  TypeScript, select front npm installed typescript, following the path

 

  Create a test file test.ts

 

let message: string = "Hello World";
console.log(message);

  When we open .ts file, there will be TypeScript tool bar at the bottom, click on the small hammer compiled

  After compiling will be more of a test.js

var message = "Hello World";
console.log(message);

 

Guess you like

Origin www.cnblogs.com/huanzi-qch/p/11232302.html