如何生成 tsconfig.json 文件? [英] How can I generate a tsconfig.json file?

查看:113
本文介绍了如何生成 tsconfig.json 文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何通过命令行生成 tsconfig.json?我试过命令 tsc init,但这不起作用.

How can I generate a tsconfig.json via the command line? I tried command tsc init, but this doesn't work.

推荐答案

支持 自 TypeScript 1.6 发布以来.

It is supported since the release of TypeScript 1.6.

正确的命令是 --init 而不是 init:

The correct command is --init not init:

$ tsc --init

尝试在您的控制台中运行以下命令以检查版本:

Try to run in your console the following to check the version:

$ tsc -v

如果版本低于 1.6,则需要更新:

If the version is older than 1.6 you will need to update:

$ npm install -g typescript

请记住,您需要安装 node.js 才能使用 npm.

Remember that you need to install node.js to use npm.

这篇关于如何生成 tsconfig.json 文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆