打字稿编译器因奇怪错误而失败
Typescript compiler failing with strange error
我收到以下错误:
events.js:141
throw er; // Unhandled 'error' event
^
TypeScript error: node_modules/gulp-typescript/release/compiler.d.ts(32,22): Error TS1005: '=' expected.
我的 gulpfile https://github.com/rtaycher/2048-Clone/blob/master/gulpfile.js
我还有一个声明文件global.d.ts:
interface Array<T> {
includes(searchElement: T) : boolean;
}
一些谷歌搜索表明声明文件可能会导致问题。
Error TS1005: '=' expected
错误是两倍。
旧版本的定义文件,例如这个版本有 readonly
https://github.com/ivogabe/gulp-typescript/blob/3645edb57278a22e08e6ae9780dc09b8ae68003e/release/compiler.d.ts#L32
不支持新关键字的旧版本编译器(如 readonly
)。
个人意见
请使用 TypeScript nightlies,否则它将永远是一场艰苦/混乱的战斗。
我收到以下错误:
events.js:141
throw er; // Unhandled 'error' event
^
TypeScript error: node_modules/gulp-typescript/release/compiler.d.ts(32,22): Error TS1005: '=' expected.
我的 gulpfile https://github.com/rtaycher/2048-Clone/blob/master/gulpfile.js
我还有一个声明文件global.d.ts:
interface Array<T> {
includes(searchElement: T) : boolean;
}
一些谷歌搜索表明声明文件可能会导致问题。
Error TS1005: '=' expected
错误是两倍。
旧版本的定义文件,例如这个版本有
readonly
https://github.com/ivogabe/gulp-typescript/blob/3645edb57278a22e08e6ae9780dc09b8ae68003e/release/compiler.d.ts#L32不支持新关键字的旧版本编译器(如
readonly
)。
个人意见
请使用 TypeScript nightlies,否则它将永远是一场艰苦/混乱的战斗。