【发布时间】:2013-08-13 13:36:07
【问题描述】:
无法编译任何 TS+node.js 项目,包括示例 http://typescript.codeplex.com/sourcecontrol/latest#samples/imageboard/README.txt 中列出的项目
总是得到以下错误:
错误 TS5037:除非提供“--module”标志,否则无法编译外部模块。
编译器版本:0.9.1.0
例如,项目只包含单个文件 app.ts:
///<reference path="./node_definitions/node.d.ts" /
import http = require("http")
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello World\n');
}).listen(1337, 'localhost');
console.log('Server running at http://localhost:1337/');
【问题讨论】:
标签: compiler-construction typescript