我正在尝试使用带有 typescript@next 的 ngc 编译我的 ionic 2 rc 应用程序:
[ben@ben app2] $ ./node_modules/.bin/ngc -p tsconfig.json
Error: Metadata emit requires the sourceFiles are passed to WriteFileCallback. Update to TypeScript ^1.9.0-dev
at MetadataWriterHost.writeFile (/home/ben/blindmate/app2/node_modules/@angular/tsc-wrapped/src/compiler_host.js:97:23)
at Object.writeFile (/home/ben/blindmate/app2/node_modules/typescript/lib/typescript.js:58205:132)
at Object.writeFile (/home/ben/blindmate/app2/node_modules/typescript/lib/typescript.js:8508:14)
at printFile (/home/ben/blindmate/app2/node_modules/typescript/lib/typescript.js:55459:16)
at emitFile (/home/ben/blindmate/app2/node_modules/typescript/lib/typescript.js:55409:21)
at onSingleFileEmit (/home/ben/blindmate/app2/node_modules/typescript/lib/typescript.js:8415:13)
at Object.forEachTransformedEmitFile (/home/ben/blindmate/app2/node_modules/typescript/lib/typescript.js:8392:21)
at Object.emitFiles (/home/ben/blindmate/app2/node_modules/typescript/lib/typescript.js:55392:12)
at emitWorker (/home/ben/blindmate/app2/node_modules/typescript/lib/typescript.js:58256:33)
at /home/ben/blindmate/app2/node_modules/typescript/lib/typescript.js:58219:66
我无法更改我的打字稿版本(@next),因为我需要支持异步/等待。有什么方法可以在不安装 typescript@1.9.0 的情况下修复此错误,如错误消息所示?
我的 tsconfig 看起来像这样:
{
"compilerOptions": {
"allowSyntheticDefaultImports": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"lib": [
"dom",
"es2015"
],
"module": "es2015",
"moduleResolution": "node",
"target": "es5"
},
"exclude": [
"node_modules",
".tmp",
"src/app/main.prod.ts"
],
"compileOnSave": false,
"atom": {
"rewriteTsconfig": false
}
}