javascript - How to include files from definitely typed in an Angular 2 project -
i'm working on angular 2/node.js app , i'm trying install typings project. when run server , start typscript compilerm following log:
bash-3.1$ npm start > support-dashboard@1.0.0 start c:\mean_project > concurrently "npm run tsc:w" "node server.js" [1] magic happens on port 8080 [0] [0] > support-dashboard@1.0.0 tsc:w c:\mean_project [0] > tsc -w [0] [0] node_modules/angular2/platform/browser.d.ts(78,90): error ts2304: cannot find name 'promise'. [0] node_modules/angular2/src/core/application_ref.d.ts(38,88): error ts2304: cannot find name 'promise'. [0] node_modules/angular2/src/core/application_ref.d.ts(92,42): error ts2304: cannot find name 'promise'. [0] node_modules/angular2/src/core/application_ref.d.ts(151,33): error ts2304: cannot find name 'promise'. [0] node_modules/angular2/src/core/change_detection/differs/default_keyvalue_differ.d.ts(23,15): error ts2304: cannot find name 'map'. [0] node_modules/angular2/src/core/change_detection/differs/default_keyvalue_differ.d.ts(25,16): error ts2304: cannot find name 'map'. [0] node_modules/angular2/src/core/di/reflective_provider.d.ts(103,123): error ts2304: cannot find name 'map'. [0] node_modules/angular2/src/core/di/reflective_provider.d.ts(103,165): error ts2304: cannot find name 'map'. [0] node_modules/angular2/src/core/linker/component_resolver.d.ts(8,53): error ts2304: cannot find name 'promise'. [0] node_modules/angular2/src/core/linker/component_resolver.d.ts(12,44): error ts2304: cannot find name 'promise'. [0] node_modules/angular2/src/core/linker/dynamic_component_loader.d.ts(59,148): error ts2304: cannot find name 'promise'. [0] node_modules/angular2/src/core/linker/dynamic_component_loader.d.ts(100,144): error ts2304: cannot find name 'promise'. [0] node_modules/angular2/src/core/linker/dynamic_component_loader.d.ts(105,139): error ts2304: cannot find name 'promise'. [0] node_modules/angular2/src/core/linker/dynamic_component_loader.d.ts(106,135): error ts2304: cannot find name 'promise'. [0] node_modules/angular2/src/facade/async.d.ts(27,33): error ts2304: cannot find name 'promise'. [0] node_modules/angular2/src/facade/async.d.ts(28,45): error ts2304: cannot find name 'promise'. [0] node_modules/angular2/src/facade/collection.d.ts(1,25): error ts2304: cannot find name 'mapconstructor'. [0] node_modules/angular2/src/facade/collection.d.ts(2,25): error ts2304: cannot find name 'setconstructor'. [0] node_modules/angular2/src/facade/collection.d.ts(4,27): error ts2304: cannot find name 'map'. [0] node_modules/angular2/src/facade/collection.d.ts(4,39): error ts2304: cannot find name 'map'. [0] node_modules/angular2/src/facade/collection.d.ts(7,9): error ts2304: cannot find name 'map'. [0] node_modules/angular2/src/facade/collection.d.ts(8,30): error ts2304: cannot find name 'map'. [0] node_modules/angular2/src/facade/collection.d.ts(11,43): error ts2304: cannot find name 'map'. [0] node_modules/angular2/src/facade/collection.d.ts(12,27): error ts2304: cannot find name 'map'. [0] node_modules/angular2/src/facade/collection.d.ts(14,23): error ts2304: cannot find name 'map'. [0] node_modules/angular2/src/facade/collection.d.ts(15,25): error ts2304: cannot find name 'map'. [0] node_modules/angular2/src/facade/collection.d.ts(100,41): error ts2304: cannot find name 'set'. [0] node_modules/angular2/src/facade/collection.d.ts(101,22): error ts2304: cannot find name 'set'. [0] node_modules/angular2/src/facade/collection.d.ts(102,25): error ts2304: cannot find name 'set'. [0] node_modules/angular2/src/facade/lang.d.ts(4,17): error ts2304: cannot find name 'map'. [0] node_modules/angular2/src/facade/lang.d.ts(5,17): error ts2304: cannot find name 'set'. [0] node_modules/angular2/src/facade/lang.d.ts(71,59): error ts2304: cannot find name 'map'. [0] node_modules/angular2/src/facade/promise.d.ts(2,14): error ts2304: cannot find name 'promise'. [0] node_modules/angular2/src/facade/promise.d.ts(8,32): error ts2304: cannot find name 'promise'. [0] node_modules/angular2/src/facade/promise.d.ts(9,38): error ts2304: cannot find name 'promise'. [0] node_modules/angular2/src/facade/promise.d.ts(10,35): error ts2304: cannot find name 'promise'. [0] node_modules/angular2/src/facade/promise.d.ts(10,93): error ts2304: cannot find name 'promise'. [0] node_modules/angular2/src/facade/promise.d.ts(11,34): error ts2304: cannot find name 'promise'. [0] node_modules/angular2/src/facade/promise.d.ts(11,50): error ts2304: cannot find name 'promise'. [0] node_modules/angular2/src/facade/promise.d.ts(12,32): error ts2304: cannot find name 'promise'. [0] node_modules/angular2/src/facade/promise.d.ts(12,149): error ts2304: cannot find name 'promise'. [0] node_modules/angular2/src/facade/promise.d.ts(13,43): error ts2304: cannot find name 'promise'. [0] node_modules/angular2/src/platform/browser/browser_adapter.d.ts(75,33): error ts2304: cannot find name 'map'. [0] node_modules/angular2/src/platform/dom/dom_adapter.d.ts(85,42): error ts2304: cannot find name 'map'. [0] node_modules/rxjs/observable.d.ts(10,66): error ts2304: cannot find name 'promise'. [0] node_modules/rxjs/observable.d.ts(66,60): error ts2304: cannot find name 'promise'. [0] node_modules/rxjs/observable.d.ts(66,70): error ts2304: cannot find name 'promise'. [0] 8:52:59 - compilation complete. watching file changes.
i searched online , found use typings cli tool in order install typings definitions; getting errors when tried install packages typings.json file through postinstall.
i saw alternative use definitely typed library github , copied es6-promise.d.ts typed , added root of project , ran server again instructed here. time, messages promise not being found went away.
what haven't been able figure out .ts files contain definitions 'map' , 'set', , 'map constructor'. which files should including in order enable typescript compilers find these libraries?
if library not include typings, can install them using npm:
npm install d3 --save npm install @types/d3 --save-dev
quoted angular-cli documentation
@types in npm contains definitely typed type definitions.
Comments
Post a Comment