DEV Community

S. M. Ahad Ali Chowdhury
S. M. Ahad Ali Chowdhury

Posted on

How to run typescript with vs code

Task 01: 
If you have not install node js . go to node js official website and download the latest version.
when download and install is completed , go to the terminal and write node - version and press Enter for sure you really download and install node js.
if node js perfectly installed , it shows a node js version which is already install in your computer.

task -02:
go to your terminal and write
npm install -g typescript and press enter.
for check the version of typescript, go to terminal and write tsc --version , you can find the version name which you install typescript just few second ago.

task -03:
create a filename.ts in your familiar location, and open vscode in this file location.
write something in your filename.ts
when it is finished, go to vs code terminal and type tsc filename.ts
when you press enter , this show nothing and also see a new file that's name is filename.js
 

(In this moment if you face an error like "tsc.ps1 cannot be loaded because running scripts is disabled on this system"
don't worry…..
go to the powershall and run this is as an administrator **and type "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned**" and press enter , the terminal want to permission so type "Y" and press enter )

and now you go to the vscode terminal again and type node filename.js and press enter 

 boom…………….
it's working hahaha

Top comments (0)