【发布时间】:2015-09-29 00:51:49
【问题描述】:
我刚刚开始使用一些打字稿代码开展一个项目,我正在尝试从 Linux Mint 中将 .ts 文件编译为 .js 文件,但它没有像我预期的那样工作。
有一个 Makefile,但它不起作用。运行make 返回错误:
tsc --noImplicitAny --noEmitOnError --out client/welcome.js client/welcome.ts
make: *** [client/welcome.js] Error 1
我还尝试创建一个示例打字稿文件greeter.ts(根据this official tutorial),其中包含:
function greeter(person) {
return "Hello, " + person;
}
var user = "Jane User";
document.body.innerHTML = greeter(user);
并尝试使用命令(根据同一教程)tsc greeter.ts 将 ts 文件编译为 javascript,但是命令完成时没有输出,也没有创建 .js 文件。
我以前根本没有使用过 typescript,虽然我之前使用过 Makefile,但我对它们也不太了解,所以我希望它真的很明显!
【问题讨论】:
标签: makefile typescript linux-mint