当前位置:网站首页>TypeScript安装
TypeScript安装
2022-07-27 16:18:00 【懒起来】
打开VsCode选择终端命令,新建命令输入
npm install -g typescript来进行下载安装TypeScript
创建一个文本后缀为.ts的文本
文本里输入一些合适的文字
const hello : string = "Hello World!"
console.log(hello)编译代码
tsc d.ts 在这里第一次使用时会显示编译失败
解决方式打开

使用管理员身份打开Windows PowerShell
输入指令
set-ExecutionPolicy RemoteSigned在下面这个界面选择Y或者A

然后再重新进行编译


这是编译成功,我们运行一下

编译时编译在指定包下
tsc .\d.ts --outDir js![]()
使用子包里的文件时
node .\js\d.js

另附基础语法库
边栏推荐
猜你喜欢

Must the MySQL query column be consistent with the group by field?

商品评论信息与评论信息分类

Complete set of machine learning classification task effect evaluation indicators (including ROC and AUC)

Uploading and downloading of files

阿里p8总结的10条 SQL 优化方案(非常实用)

nacos显示服务注册地址错误

低噪负离子风扇触摸IC

Redis注解

Visual studio code installation tutorial (super detailed)

Uni app traversal array rendering data vertical rendering
随机推荐
js实现简易表单验证与全选功能
Functions in JS and the use of DOM to obtain elements and event attributes
飞机大战敌机出场
网红RGB镜子灯触摸芯片-DLT8S15B-杰力科创
MySQL create event execution task
Visual Studio Code安装教程(超详细)
Machine learning -- error caused by only one kind of label data in SVM training set
Hbuilder submission code
2021.7.28 notes
微信支付及支付回调
2021.8.1 notes DBA
pygame飞机大战游戏背景实现
Nacos display service registration address error
MySQL 主从复制数据不一致,怎么办?
Visual studio code installation tutorial (super detailed)
Order timeout cancellation and commodity query by category
Knowledge map pyhanlp realizes named body recognition (with named body recognition code)
商品评论信息与评论信息分类
Join query and subquery
10 SQL optimization schemes summarized by Alibaba P8 (very practical)