タイピングがTypeScriptコンパイラの設定に含まれていることを確認してください。あなたいくつかの方法でそれらを含めることができます。このポイントはtypings/
フォルダに
/// <reference path="../typings/browser.d.ts" />
と:
// tsconfig.json
{
"files": [
...,
"typings.d.ts",
]
}
または最初のファイルコンパイラのいずれかでtypings.d.ts
内容は(のような、main.js
またはbootstrap.js
)を探し含めますtypings install whatever
コマンドを使用してインストールしたすべての定義を持つファイル。たとえば、これはファイルAngularCLIです。
// browser.d.ts
/// <reference path="browser/ambient/angular-protractor/index.d.ts" />
/// <reference path="browser/ambient/es6-shim/index.d.ts" />
/// <reference path="browser/ambient/jasmine/index.d.ts" />
/// <reference path="browser/ambient/node/index.d.ts" />
/// <reference path="browser/ambient/selenium-webdriver/index.d.ts" />
TS2304:名前を見つけることができません「約束」
このエラーは、コンパイラがes6-shim/index.d.ts
に位置しているの約束、の定義を見つけることができないことを示しています。