Angular2の輸入を含ま活字体をコンパイルするときWebstormで警告を取得。 app.ts
がコンパイルされているときにWebStormコンソールで警告が表示される。ここで私は、すべてのクイックスタートマニュアルに従ってここ<a href="https://angular.io/guide/quickstart" rel="nofollow noreferrer">https://angular.io/guide/quickstart</a></p> <p>私がやったから例を取っ
は詳細です:
私は、Windows 8.1のx64、Webstorm 11.0.1
app.ts
日午前:私はtsconfig.json
ファイルを置いた
{
"compilerOptions": {
"target": "ES5",
"module": "commonjs",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"removeComments": false,
"noImplicitAny": false,
"sourceRoot": "/"
},
"exclude": [
"node_modules"
]
}
:
import {bootstrap, Component} from 'angular2/angular2';
@Component({
selector: 'my-app',
template: '<h1>My First Angular 3 App</h1>'
})
class AppComponent { }
bootstrap(AppComponent);
tsconfig.json
〜app
フォルダーそして根の中にある。
app.ts
実際に取得何らかの理由でファイルにコンパイルが、取得警告:
error TS1148: Cannot compile modules unless the '--module' flag is provided.
error TS2307: Cannot find module 'angular2/angular2'.
error TS1205: Decorators are only available when targeting ECMAScript 5 and higher.
error TS1219: Experimental support for decorators is a feature that is subject to change in a future release. Specify '--experimentalDecorators' to remove this warning.
私が持っているタイピングは
マイフォルダ構造
編集が含まれていました。
私は設定でtsconfig.json
を設定した後にエラーがTypescript
ウィンドウ
から姿を消したが、Run
出力とコードエディタでのエラーを得た:
![enter image description here](https://i.stack.imgur.com/skkkf.png)
はtsconfig.json
では問題がありません
更新日:
ファイル - >設定 - >言語&フレームワーク - >タイプスクリプトtsconfig.json
に切り替えるのを助けた。それから、手動で以前に有効にしたTypescriptウォッチャーを無効にすることで、次の問題を解決しました。ファイル - >設定 - >ツール - >ファイルウォッチャー。今これらの設定ですべてが正常に動作しています。
この[問題](https://github.com/angular/angular/issues/5248)があなたの問題に関連しているかどうかはわかりませんが、読んだだけでは分かりません。 –