Preface: If you want to build TypeScript environment constructionStep 1: Download Taobao mirrorFirst check whether you have successfully installed npm It is not enough to have npm, you also need to download cnpm, the command is as follows (copy and paste directly):
After downloading, it will appear like this. Step 2: Download TypeScriptIn the command window, enter (copy and paste directly):
Download it like this. Check the version number:
This way TS is completely ready. Deploy to VSCodeFirst create a folder tsDemo, Create a demo.ts file in the tsDemo folder and write the content. . Then you need to generate a tsconfig.json file at this location.
Then the tsconfig.json file will be generated in the tsDemo folder. Modify tsconfig.json configuration Drag the tsDemo folder to vsCode. , find tsconfig.json, Then select the ts file and click: Terminal => Run Build Task. Click tsc: monitor Then a js folder will be generated in the terminal, which contains the js file compiled from the ts file. Possible errors
Solution : Run vscode as administrator. Then enter in the terminal:
It won't report an error. ps: Let's take a look at how vscode executes typescript files. 1. Execute the tsc xxx.ts command in the vscode console to convert it to xxx.js 2. Execute node xxx.ts to output the result This is the end of this article about the detailed steps of setting up the TypeScript environment and deploying it to VSCode. For more information about setting up the TypeScript environment, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: CSS3 realizes draggable Rubik's Cube 3D effect
>>: MySQL query redundant indexes and unused index operations
Table of contents Overview 1. Hook calling order ...
In fact, this problem has already popped up when I...
Cause of failure Today, when I was writing a caro...
Port 80 is also configured. First enter the firew...
Preface Under the influence of some CSS interacti...
1: Understand the meaning of address rewriting an...
1. Business Background Using a mask layer to shie...
Preface After a long time of reading various mate...
1. Download MySQL Workbench Workbench is a graphi...
Table of contents Tomcat class loader hierarchy W...
<br />Adding pictures reasonably can make a ...
1. The div css mouse hand shape is cursor:pointer;...
I recently started learning about database knowle...
Docker official documentation: https://docs.docke...
How to reset the initial value of the auto-increm...