node.js - error TS2304: Cannot find name 'Promise' -


hello guys went through solution avaialble on stackoverflow. none of work me. hence posting question. tsconfig.json

{   "version":"2.13.0",   "compileroptions": {     "target": "es5",     "module": "commonjs",     "sourcemap": true,     "emitdecoratormetadata": true,     "experimentaldecorators": true,     "removecomments": true,     "noimplicitany": false       },   "exclude": [         "node_modules"     ] } 

package.json

{   "name": "anguapp",   "version": "1.0.0",   "description": "angular2 gulp typescript , express",   "main": "dist/server.js",   "scripts": {     "test": "echo \"error: no test specified\" && exit 1",     "postinstall": "gulp build"   },   "keywords": [],   "author": "uk",   "license": "mit",   "dependencies": {     "angular2": "2.0.0-beta.17",      "es6-promise": "3.2.1",     "es6-shim": "0.35.1",     "body-parser":"1.15.2",     "express": "4.13.3",     "gulp-concat": "2.6.0",     "reflect-metadata": "0.1.8",     "rxjs": "5.0.0-beta.6",     "systemjs": "0.19.37",     "zone.js": "0.6.17",     "mongodb" :"2.2.8",      "ejs" : "~0.8.5"               },   "devdependencies": {     "del": "2.2.2",     "gulp": "3.9.1",     "gulp-concat": "2.6.0",     "gulp-sourcemaps": "1.6.0",     "gulp-typescript": "2.13.0",     "run-sequence": "1.1.5"   } } 

while doing gulp getting following errors.

[12:39:43] using gulpfile d:\repository\documents\personal\abha-du\gulpfile.js [12:39:43] starting 'build'... [12:39:43] starting 'clean'... [12:39:43] finished 'clean' after 66 ms [12:39:43] starting 'build:server'... [12:39:45] finished 'build:server' after 2.18 s [12:39:45] starting 'build:index'... [12:39:46] finished 'build:index' after 21 ms [12:39:46] starting 'build:app'... d:/repository/documents/personal/abha-du/node_modules/angular2/platform/browser. d.ts(78,90): error ts2304: cannot find name 'promise'. d:/repository/documents/personal/abha-du/node_modules/angular2/src/common/direct ives/ng_class.d.ts(72,35): error ts2304: cannot find name 'set'. d:/repository/documents/personal/abha-du/node_modules/angular2/src/common/pipes/ async_pipe.d.ts(25,38): error ts2304: cannot find name 'promise'. d:/repository/documents/personal/abha-du/node_modules/angular2/src/core/applicat ion_ref.d.ts(38,88): error ts2304: cannot find name 'promise'. d:/repository/documents/personal/abha-du/node_modules/angular2/src/core/applicat ion_ref.d.ts(92,42): error ts2304: cannot find name 'promise'. d:/repository/documents/personal/abha-du/node_modules/angular2/src/core/applicat ion_ref.d.ts(151,33): error ts2304: cannot find name 'promise'. d:/repository/documents/personal/abha-du/node_modules/angular2/src/core/change_d etection/differs/default_keyvalue_differ.d.ts(23,15): error ts2304: cannot find name 'map'. d:/repository/documents/personal/abha-du/node_modules/angular2/src/core/change_d etection/differs/default_keyvalue_differ.d.ts(25,16): error ts2304: cannot find name 'map'. d:/repository/documents/personal/abha-du/node_modules/angular2/src/core/di/refle ctive_provider.d.ts(103,123): error ts2304: cannot find name 'map'. d:/repository/documents/personal/abha-du/node_modules/angular2/src/core/di/refle ctive_provider.d.ts(103,165): error ts2304: cannot find name 'map'. d:/repository/documents/personal/abha-du/node_modules/angular2/src/core/linker/c omponent_resolver.d.ts(8,53): error ts2304: cannot find name 'promise'. d:/repository/documents/personal/abha-du/node_modules/angular2/src/core/linker/c omponent_resolver.d.ts(12,44): error ts2304: cannot find name 'promise'. d:/repository/documents/personal/abha-du/node_modules/angular2/src/core/linker/d ynamic_component_loader.d.ts(59,148): error ts2304: cannot find name 'promise'. d:/repository/documents/personal/abha-du/node_modules/angular2/src/core/linker/d ynamic_component_loader.d.ts(100,144): error ts2304: cannot find name 'promise'.  d:/repository/documents/personal/abha-du/node_modules/angular2/src/core/linker/d ynamic_component_loader.d.ts(105,139): error ts2304: cannot find name 'promise'.  d:/repository/documents/personal/abha-du/node_modules/angular2/src/core/linker/d ynamic_component_loader.d.ts(106,135): error ts2304: cannot find name 'promise'.  d:/repository/documents/personal/abha-du/node_modules/angular2/src/facade/async. d.ts(27,33): error ts2304: cannot find name 'promise'. d:/repository/documents/personal/abha-du/node_modules/angular2/src/facade/async. d.ts(28,45): error ts2304: cannot find name 'promise'. d:/repository/documents/personal/abha-du/node_modules/angular2/src/facade/collec tion.d.ts(1,25): error ts2304: cannot find name 'mapconstructor'. d:/repository/documents/personal/abha-du/node_modules/angular2/src/facade/collec tion.d.ts(2,25): error ts2304: cannot find name 'setconstructor'. d:/repository/documents/personal/abha-du/node_modules/angular2/src/facade/collec tion.d.ts(4,27): error ts2304: cannot find name 'map'. d:/repository/documents/personal/abha-du/node_modules/angular2/src/facade/collec tion.d.ts(4,39): error ts2304: cannot find name 'map'. d:/repository/documents/personal/abha-du/node_modules/angular2/src/facade/collec tion.d.ts(7,9): error ts2304: cannot find name 'map'. d:/repository/documents/personal/abha-du/node_modules/angular2/src/facade/collec tion.d.ts(8,30): error ts2304: cannot find name 'map'. d:/repository/documents/personal/abha-du/node_modules/angular2/src/facade/collec tion.d.ts(11,43): error ts2304: cannot find name 'map'. d:/repository/documents/personal/abha-du/node_modules/angular2/src/facade/collec tion.d.ts(12,27): error ts2304: cannot find name 'map'. d:/repository/documents/personal/abha-du/node_modules/angular2/src/facade/collec tion.d.ts(14,23): error ts2304: cannot find name 'map'. d:/repository/documents/personal/abha-du/node_modules/angular2/src/facade/collec tion.d.ts(15,25): error ts2304: cannot find name 'map'. d:/repository/documents/personal/abha-du/node_modules/angular2/src/facade/collec tion.d.ts(100,41): error ts2304: cannot find name 'set'. d:/repository/documents/personal/abha-du/node_modules/angular2/src/facade/collec tion.d.ts(101,22): error ts2304: cannot find name 'set'. d:/repository/documents/personal/abha-du/node_modules/angular2/src/facade/collec tion.d.ts(102,25): error ts2304: cannot find name 'set'. d:/repository/documents/personal/abha-du/node_modules/angular2/src/facade/lang.d .ts(4,17): error ts2304: cannot find name 'map'. d:/repository/documents/personal/abha-du/node_modules/angular2/src/facade/lang.d .ts(5,17): error ts2304: cannot find name 'set'. d:/repository/documents/personal/abha-du/node_modules/angular2/src/facade/lang.d .ts(71,59): error ts2304: cannot find name 'map'. d:/repository/documents/personal/abha-du/node_modules/angular2/src/facade/promis e.d.ts(2,14): error ts2304: cannot find name 'promise'. d:/repository/documents/personal/abha-du/node_modules/angular2/src/facade/promis e.d.ts(8,32): error ts2304: cannot find name 'promise'. d:/repository/documents/personal/abha-du/node_modules/angular2/src/facade/promis e.d.ts(9,38): error ts2304: cannot find name 'promise'. d:/repository/documents/personal/abha-du/node_modules/angular2/src/facade/promis e.d.ts(10,35): error ts2304: cannot find name 'promise'. d:/repository/documents/personal/abha-du/node_modules/angular2/src/facade/promis e.d.ts(10,93): error ts2304: cannot find name 'promise'. d:/repository/documents/personal/abha-du/node_modules/angular2/src/facade/promis e.d.ts(11,34): error ts2304: cannot find name 'promise'. d:/repository/documents/personal/abha-du/node_modules/angular2/src/facade/promis e.d.ts(11,50): error ts2304: cannot find name 'promise'. d:/repository/documents/personal/abha-du/node_modules/angular2/src/facade/promis e.d.ts(12,32): error ts2304: cannot find name 'promise'. d:/repository/documents/personal/abha-du/node_modules/angular2/src/facade/promis e.d.ts(12,149): error ts2304: cannot find name 'promise'. d:/repository/documents/personal/abha-du/node_modules/angular2/src/facade/promis e.d.ts(13,43): error ts2304: cannot find name 'promise'. d:/repository/documents/personal/abha-du/node_modules/angular2/src/http/headers. d.ts(43,59): error ts2304: cannot find name 'map'. d:/repository/documents/personal/abha-du/node_modules/angular2/src/http/url_sear ch_params.d.ts(11,16): error ts2304: cannot find name 'map'. d:/repository/documents/personal/abha-du/node_modules/angular2/src/platform/brow ser/browser_adapter.d.ts(75,33): error ts2304: cannot find name 'map'. d:/repository/documents/personal/abha-du/node_modules/angular2/src/platform/dom/ dom_adapter.d.ts(85,42): error ts2304: cannot find name 'map'. d:/repository/documents/personal/abha-du/node_modules/angular2/src/router/direct ives/router_outlet.d.ts(27,54): error ts2304: cannot find name 'promise'. d:/repository/documents/personal/abha-du/node_modules/angular2/src/router/direct ives/router_outlet.d.ts(33,51): error ts2304: cannot find name 'promise'. d:/repository/documents/personal/abha-du/node_modules/angular2/src/router/direct ives/router_outlet.d.ts(38,56): error ts2304: cannot find name 'promise'. d:/repository/documents/personal/abha-du/node_modules/angular2/src/router/direct ives/router_outlet.d.ts(47,65): error ts2304: cannot find name 'promise'. d:/repository/documents/personal/abha-du/node_modules/angular2/src/router/direct ives/router_outlet.d.ts(58,60): error ts2304: cannot find name 'promise'. d:/repository/documents/personal/abha-du/node_modules/angular2/src/router/instru ction.d.ts(124,34): error ts2304: cannot find name 'promise'. d:/repository/documents/personal/abha-du/node_modules/angular2/src/router/instru ction.d.ts(148,25): error ts2304: cannot find name 'promise'. d:/repository/documents/personal/abha-du/node_modules/angular2/src/router/instru ction.d.ts(164,34): error ts2304: cannot find name 'promise'. d:/repository/documents/personal/abha-du/node_modules/angular2/src/router/instru ction.d.ts(167,25): error ts2304: cannot find name 'promise'. d:/repository/documents/personal/abha-du/node_modules/angular2/src/router/interf aces.d.ts(21,107): error ts2304: cannot find name 'promise'. d:/repository/documents/personal/abha-du/node_modules/angular2/src/router/interf aces.d.ts(39,104): error ts2304: cannot find name 'promise'. d:/repository/documents/personal/abha-du/node_modules/angular2/src/router/interf aces.d.ts(57,109): error ts2304: cannot find name 'promise'. d:/repository/documents/personal/abha-du/node_modules/angular2/src/router/interf aces.d.ts(80,109): error ts2304: cannot find name 'promise'. d:/repository/documents/personal/abha-du/node_modules/angular2/src/router/interf aces.d.ts(102,114): error ts2304: cannot find name 'promise'. d:/repository/documents/personal/abha-du/node_modules/angular2/src/router/lifecy cle/lifecycle_annotations.d.ts(29,100): error ts2304: cannot find name 'promise' . d:/repository/documents/personal/abha-du/node_modules/angular2/src/router/route_ config/route_config_impl.d.ts(101,19): error ts2304: cannot find name 'promise'.  d:/repository/documents/personal/abha-du/node_modules/angular2/src/router/route_ definition.d.ts(20,20): error ts2304: cannot find name 'promise'. d:/repository/documents/personal/abha-du/node_modules/angular2/src/router/route_ definition.d.ts(35,20): error ts2304: cannot find name 'promise'. d:/repository/documents/personal/abha-du/node_modules/angular2/src/router/route_ registry.d.ts(52,66): error ts2304: cannot find name 'promise'. d:/repository/documents/personal/abha-du/node_modules/angular2/src/router/router .d.ts(56,50): error ts2304: cannot find name 'promise'. d:/repository/documents/personal/abha-du/node_modules/angular2/src/router/router .d.ts(68,46): error ts2304: cannot find name 'promise'. d:/repository/documents/personal/abha-du/node_modules/angular2/src/router/router .d.ts(86,45): error ts2304: cannot find name 'promise'. d:/repository/documents/personal/abha-du/node_modules/angular2/src/router/router .d.ts(99,34): error ts2304: cannot find name 'promise'. d:/repository/documents/personal/abha-du/node_modules/angular2/src/router/router .d.ts(107,64): error ts2304: cannot find name 'promise'. d:/repository/documents/personal/abha-du/node_modules/angular2/src/router/router .d.ts(112,85): error ts2304: cannot find name 'promise'. d:/repository/documents/personal/abha-du/node_modules/angular2/src/router/router .d.ts(120,70): error ts2304: cannot find name 'promise'. d:/repository/documents/personal/abha-du/node_modules/angular2/src/router/router .d.ts(128,43): error ts2304: cannot find name 'promise'. d:/repository/documents/personal/abha-du/node_modules/angular2/src/router/router .d.ts(132,29): error ts2304: cannot find name 'promise'. d:/repository/documents/personal/abha-du/node_modules/angular2/src/router/router .d.ts(138,19): error ts2304: cannot find name 'promise'. d:/repository/documents/personal/abha-du/node_modules/angular2/src/router/router .d.ts(146,70): error ts2304: cannot find name 'promise'. d:/repository/documents/personal/abha-du/node_modules/rxjs/observable.d.ts(10,66 ): error ts2304: cannot find name 'promise'. d:/repository/documents/personal/abha-du/node_modules/rxjs/observable.d.ts(66,60 ): error ts2304: cannot find name 'promise'. d:/repository/documents/personal/abha-du/node_modules/rxjs/observable.d.ts(66,70 ): error ts2304: cannot find name 'promise'. d:/repository/documents/personal/abha-du/node_modules/rxjs/operator/topromise.d. ts(7,59): error ts2304: cannot find name 'promise'. d:/repository/documents/personal/abha-du/node_modules/rxjs/operator/topromise.d. ts(7,69): error ts2304: cannot find name 'promise'. d:/repository/documents/personal/abha-du/node_modules/rxjs/operator/topromise.d. ts(9,9): error ts2304: cannot find name 'promise'. d:/repository/documents/personal/abha-du/node_modules/rxjs/operator/topromise.d. ts(10,26): error ts2304: cannot find name 'promise'. d:/repository/documents/personal/abha-du/node_modules/rxjs/operator/topromise.d. ts(10,36): error ts2304: cannot find name 'promise'. [12:39:47] typescript: 86 semantic errors [12:39:47] typescript: emit succeeded (with errors) [12:39:47] finished 'build:app' after 1.93 s [12:39:47] starting 'build:home'... [12:39:47] finished 'build:home' after 7.17 ms [12:39:47] finished 'build' after 4.23 s [12:39:47] starting 'default'... [12:39:47] finished 'default' after 12 µs 

please me solve these ts2304: cannot find name 'promise' errors

you need change target es6 inside tsconfig.json resolve issue.

{   "version":"2.13.0",   "compileroptions": {     "target": "es6", //<- change here     ......   },   "exclude": [         "node_modules"     ] } 

other way can is, need make sure have es6-shim.js have been referred there on page , follow this answer not need change target option.


Comments

Popular posts from this blog

mysql - Dreamhost PyCharm Django Python 3 Launching a Site -

java - Sending SMS with SMSLib and Web Services -

java - How to resolve The method toString() in the type Object is not applicable for the arguments (InputStream) -