私は、angle2 2.0.0-rc.4、typescript 1.8.7、momentjsを使用したビジュアルスタジオ2015プロジェクトを持っています。プロジェクトをビルドしようとすると、2 moment.d.tsのコンパイルエラー。私はtypescriptコンパイラがそのファイルをコンパイルするのを避けることを試みました。角2モメンタムとモーフィングエラーが発生しました。
これは私のtsconfing.jsonです:
{
"compilerOptions": {
"noImplicitAny": false,
"module": "system",
"moduleResolution": "node",
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"noEmitOnError": false,
"removeComments": false,
"sourceMap": true,
"target": "es5",
"allowSyntheticDefaultImports": true
},
"exclude": [
"node_modules",
"typings",
"wwwroot"
]
}
私が得たエラー:
C:/Projects/MyProject/src/MyProject/node_modules/moment/moment.d.ts(210,22): error TS1110: Type expected.
C:/Projects/MyProject/src/MyProject/node_modules/moment/moment.d.ts(218,52): error TS1005: ';' expected.
そして、私は私の.TSにこのよう
import * as moment from 'moment';
を瞬間をインポートしています持っています以前誰かがこの問題に遭遇しましたか?ありがとう。
は、あなたがそれをインストールしたときに、このコマンドを使用する?:タイピングは、はい、私がやった – eg16
--save瞬間をインストールしました。私もそれをアンインストールして、もう一度再インストールしました – user2574370