简体   繁体   English

typescript如何编译?

[英]How to compile typescript?

If I use tsc it doesn't work.如果我使用 tsc 它不起作用。 If I don't have tsc but have typescript, it still doesn't work.如果我没有 tsc 但有 typescript,它仍然不起作用。 What can I do?我能做什么? 打包json和报错信息

You have to install the typescript library like this.您必须像这样安装 typescript 库。

npm install typescript --save-dev

Then npx tsc command will work.然后npx tsc命令将起作用。

What you have installed is a deprecated library called tsc Check here .您安装的是一个已弃用的库,名为tsc Check here So you may have to remove that first with the following command所以你可能必须先用下面的命令删除它

npm uninstall tsc

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM