node.js - Typescript ข้อผิดพลาด TS1005: คาดว่าเจอ ';'
ฉันกำลังพยายามคอมไพล์ไฟล์ TypeScript นี้:
import http = module("http");
import express = module("express");
ด้วยพารามิเตอร์เหล่านี้:
C:/nodejs/tsc.cmd --sourcemap cheese.ts --module commonjs
C:/User/Node/ExpressProject/cheese.ts(5,21): error TS1005: ';' expected.
C:/User/Node/ExpressProject/cheese.ts(6,24): error TS1005: ';' expected.
ฉันทำอะไรผิดหรือ? แม้จะมีสิ่งนี้ ฉันก็ยังได้รับข้อผิดพลาดเหมือนเดิม:
module "http" {}
module "express" {}
import http = module("http");
import express = module("express");
ใช้ Typescript เวอร์ชัน 0.9.1
คำตอบ #1
ไวยากรณ์ใน 0.9.1 ตอนนี้คือ import mod=require('modname');