angular - gulp task runner giving error -


i getting error while doing task runner "gulp" file, sample project angular 2 , asp.net core.

i have "typings" folder in place, has below "typings.json" file,

{ "resolution": "main", "tree": { "src": "https://raw.githubusercontent.com/definitelytyped/definitelytyped/be0ba281b67575b3b626a6bbb15b152add97244e/core-js/core-js.d.ts", "raw": "registry:dt/core-js#0.0.0+20160914114559", "typings": "https://raw.githubusercontent.com/definitelytyped/definitelytyped/be0ba281b67575b3b626a6bbb15b152add97244e/core-js/core-js.d.ts" } }

enter image description here

below "gulp" file,

/*  file in main entry point defining gulp tasks , using gulp plugins.  click here learn more. http://go.microsoft.com/fwlink/?linkid=518007  */  var gulp = require('gulp'),      gp_clean = require('gulp-clean'),      gp_concat = require('gulp-concat'),      gp_sourcemaps = require('gulp-sourcemaps'),      gp_typescript = require('gulp-typescript'),      gp_uglify = require('gulp-uglify');        // define paths  var srcpaths = {      app: ['scripts/app/main.ts', 'scripts/app/**/*.ts'],      js: [      'scripts/js/**/*.js',      'node_modules/core-js/client/shim.min.js',      'node_modules/zone.js/dist/zone.js',      'node_modules/reflect-metadata/reflect.js',      'node_modules/systemjs/dist/system.src.js',      'node_modules/typescript/lib/typescript.js'      ],      js_angular: [      'node_modules/@angular/**'      ],      js_rxjs: [      'node_modules/rxjs/**'      ]  };    var destpaths = {      app: 'wwwroot/app/',      js: 'wwwroot/js/',      js_angular: 'wwwroot/js/@angular/',      js_rxjs: 'wwwroot/js/rxjs/'  };    // compile, minify , create sourcemaps typescript files , place  //them wwwroot/app, js.map files.    gulp.task('app', ['app_clean'], function () {      return gulp.src(srcpaths.app)          .pipe(gp_sourcemaps.init())          //.pipe(plugins.typescript(tsproject))          .pipe(gp_typescript(require('./tsconfig.json').compileroptions))          .pipe(gp_uglify({ mangle: false }))          .pipe(gp_sourcemaps.write('/'))          .pipe(gulp.dest(destpaths.app));  });    // delete wwwroot/app contents  gulp.task('app_clean', function () {      return gulp.src(destpaths.app + "*", { read: false })      .pipe(gp_clean({ force: true }));  });    // copy js files external libraries wwwroot/js  gulp.task('js', function () {      gulp.src(srcpaths.js_angular)          .pipe(gulp.dest(destpaths.js_angular));      gulp.src(srcpaths.js_rxjs)      .pipe(gulp.dest(destpaths.js_rxjs));      return gulp.src(srcpaths.js)      // .pipe(gp_uglify({ mangle: false })) // disable uglify      // .pipe(gp_concat('all-js.min.js')) // disable concat      .pipe(gulp.dest(destpaths.js));  });    // delete wwwroot/js contents  gulp.task('js_clean', function () {      return gulp.src(destpaths.js + "*", { read: false })      .pipe(gp_clean({ force: true }));  });    // watch specified files , define upon file changes  gulp.task('watch', function () {      gulp.watch([srcpaths.app, srcpaths.js], ['app', 'js']);  });    // global cleanup task  gulp.task('cleanup', ['app_clean', 'js_clean']);    // define default task launch other tasks  gulp.task('default', ['app', 'js', 'watch']);

below 67 error,

c:\01work\opengamelist\src\opengamelistwebapp> cmd.exe /c gulp -b "c:\01work\opengamelist\src\opengamelistwebapp" --color --gulpfile "c:\01work\opengamelist\src\opengamelistwebapp\gulpfile.js" default  [11:39:57] using gulpfile c:\01work\opengamelist\src\opengamelistwebapp\gulpfile.js  [11:39:57] starting 'app_clean'...  [11:39:57] starting 'js'...  [11:39:57] starting 'watch'...  [11:39:57] finished 'watch' after 37 ms  [11:39:58] finished 'app_clean' after 543 ms  [11:39:58] starting 'app'...  c:/01work/opengamelist/src/opengamelistwebapp/node_modules/@angular/common/src/directives/ng_class.d.ts(46,34): error ts2304: cannot find name 'set'.  c:/01work/opengamelist/src/opengamelistwebapp/node_modules/@angular/common/src/pipes/async_pipe.d.ts(39,38): error ts2304: cannot find name 'promise'.  c:/01work/opengamelist/src/opengamelistwebapp/node_modules/@angular/compiler/src/compile_metadata.d.ts(347,20): error ts2304: cannot find name 'set'.  c:/01work/opengamelist/src/opengamelistwebapp/node_modules/@angular/compiler/src/compile_metadata.d.ts(348,15): error ts2304: cannot find name 'set'.  c:/01work/opengamelist/src/opengamelistwebapp/node_modules/@angular/compiler/src/directive_normalizer.d.ts(19,100): error ts2304: cannot find name 'promise'.  c:/01work/opengamelist/src/opengamelistwebapp/node_modules/@angular/compiler/src/directive_normalizer.d.ts(21,74): error ts2304: cannot find name 'promise'.  c:/01work/opengamelist/src/opengamelistwebapp/node_modules/@angular/compiler/src/offline_compiler.d.ts(15,26): error ts2304: cannot find name 'map'.  c:/01work/opengamelist/src/opengamelistwebapp/node_modules/@angular/compiler/src/offline_compiler.d.ts(16,38): error ts2304: cannot find name 'map'.  c:/01work/opengamelist/src/opengamelistwebapp/node_modules/@angular/compiler/src/offline_compiler.d.ts(31,124): error ts2304: cannot find name 'promise'.  c:/01work/opengamelist/src/opengamelistwebapp/node_modules/@angular/compiler/src/output/output_ast.d.ts(424,63): error ts2304: cannot find name 'set'.  c:/01work/opengamelist/src/opengamelistwebapp/node_modules/@angular/compiler/src/resource_loader.d.ts(13,23): error ts2304: cannot find name 'promise'.  c:/01work/opengamelist/src/opengamelistwebapp/node_modules/@angular/compiler/src/runtime_compiler.d.ts(40,49): error ts2304: cannot find name 'promise'.  c:/01work/opengamelist/src/opengamelistwebapp/node_modules/@angular/compiler/src/runtime_compiler.d.ts(42,65): error ts2304: cannot find name 'promise'.  c:/01work/opengamelist/src/opengamelistwebapp/node_modules/@angular/compiler/src/template_parser/template_parser.d.ts(45,12): error ts2304: cannot find name 'set'.  c:/01work/opengamelist/src/opengamelistwebapp/node_modules/@angular/compiler/src/util.d.ts(35,18): error ts2304: cannot find name 'promise'.  c:/01work/opengamelist/src/opengamelistwebapp/node_modules/@angular/compiler/src/util.d.ts(36,46): error ts2304: cannot find name 'promise'.  c:/01work/opengamelist/src/opengamelistwebapp/node_modules/@angular/compiler/src/view_compiler/compile_element.d.ts(33,16): error ts2304: cannot find name 'map'.  c:/01work/opengamelist/src/opengamelistwebapp/node_modules/@angular/compiler/src/view_compiler/compile_query.d.ts(24,49): error ts2304: cannot find name 'map'.  c:/01work/opengamelist/src/opengamelistwebapp/node_modules/@angular/compiler/src/view_compiler/compile_view.d.ts(29,18): error ts2304: cannot find name 'map'.  c:/01work/opengamelist/src/opengamelistwebapp/node_modules/@angular/compiler/src/view_compiler/compile_view.d.ts(52,16): error ts2304: cannot find name 'map'.  c:/01work/opengamelist/src/opengamelistwebapp/node_modules/@angular/compiler/src/view_compiler/compile_view.d.ts(54,13): error ts2304: cannot find name 'map'.  c:/01work/opengamelist/src/opengamelistwebapp/node_modules/@angular/core/src/application_init.d.ts(16,18): error ts2304: cannot find name 'promise'.  c:/01work/opengamelist/src/opengamelistwebapp/node_modules/@angular/core/src/application_ref.d.ts(106,67): error ts2304: cannot find name 'promise'.  c:/01work/opengamelist/src/opengamelistwebapp/node_modules/@angular/core/src/application_ref.d.ts(122,101): error ts2304: cannot find name 'promise'.  c:/01work/opengamelist/src/opengamelistwebapp/node_modules/@angular/core/src/application_ref.d.ts(148,67): error ts2304: cannot find name 'promise'.  c:/01work/opengamelist/src/opengamelistwebapp/node_modules/@angular/core/src/application_ref.d.ts(150,101): error ts2304: cannot find name 'promise'.  c:/01work/opengamelist/src/opengamelistwebapp/node_modules/@angular/core/src/change_detection/differs/default_keyvalue_differ.d.ts(24,15): error ts2304: cannot find name 'map'.  c:/01work/opengamelist/src/opengamelistwebapp/node_modules/@angular/core/src/change_detection/differs/default_keyvalue_differ.d.ts(28,16): error ts2304: cannot find name 'map'.  c:/01work/opengamelist/src/opengamelistwebapp/node_modules/@angular/core/src/di/reflective_provider.d.ts(88,123): error ts2304: cannot find name 'map'.  c:/01work/opengamelist/src/opengamelistwebapp/node_modules/@angular/core/src/di/reflective_provider.d.ts(88,165): error ts2304: cannot find name 'map'.  c:/01work/opengamelist/src/opengamelistwebapp/node_modules/@angular/core/src/facade/collection.d.ts(2,25): error ts2304: cannot find name 'mapconstructor'.  c:/01work/opengamelist/src/opengamelistwebapp/node_modules/@angular/core/src/facade/collection.d.ts(3,25): error ts2304: cannot find name 'setconstructor'.  c:/01work/opengamelist/src/opengamelistwebapp/node_modules/@angular/core/src/facade/collection.d.ts(5,27): error ts2304: cannot find name 'map'.  c:/01work/opengamelist/src/opengamelistwebapp/node_modules/@angular/core/src/facade/collection.d.ts(5,39): error ts2304: cannot find name 'map'.  c:/01work/opengamelist/src/opengamelistwebapp/node_modules/@angular/core/src/facade/collection.d.ts(8,9): error ts2304: cannot find name 'map'.  c:/01work/opengamelist/src/opengamelistwebapp/node_modules/@angular/core/src/facade/collection.d.ts(9,30): error ts2304: cannot find name 'map'.  c:/01work/opengamelist/src/opengamelistwebapp/node_modules/@angular/core/src/facade/collection.d.ts(12,43): error ts2304: cannot find name 'map'.  c:/01work/opengamelist/src/opengamelistwebapp/node_modules/@angular/core/src/facade/collection.d.ts(13,27): error ts2304: cannot find name 'map'.  c:/01work/opengamelist/src/opengamelistwebapp/node_modules/@angular/core/src/facade/collection.d.ts(15,23): error ts2304: cannot find name 'map'.  c:/01work/opengamelist/src/opengamelistwebapp/node_modules/@angular/core/src/facade/collection.d.ts(16,25): error ts2304: cannot find name 'map'.  c:/01work/opengamelist/src/opengamelistwebapp/node_modules/@angular/core/src/facade/collection.d.ts(101,41): error ts2304: cannot find name 'set'.  c:/01work/opengamelist/src/opengamelistwebapp/node_modules/@angular/core/src/facade/collection.d.ts(102,22): error ts2304: cannot find name 'set'.  c:/01work/opengamelist/src/opengamelistwebapp/node_modules/@angular/core/src/facade/collection.d.ts(103,25): error ts2304: cannot find name 'set'.  c:/01work/opengamelist/src/opengamelistwebapp/node_modules/@angular/core/src/facade/lang.d.ts(12,17): error ts2304: cannot find name 'map'.  c:/01work/opengamelist/src/opengamelistwebapp/node_modules/@angular/core/src/facade/lang.d.ts(13,17): error ts2304: cannot find name 'set'.  c:/01work/opengamelist/src/opengamelistwebapp/node_modules/@angular/core/src/facade/lang.d.ts(51,59): error ts2304: cannot find name 'map'.  c:/01work/opengamelist/src/opengamelistwebapp/node_modules/@angular/core/src/linker/compiler.d.ts(53,49): error ts2304: cannot find name 'promise'.  c:/01work/opengamelist/src/opengamelistwebapp/node_modules/@angular/core/src/linker/compiler.d.ts(61,65): error ts2304: cannot find name 'promise'.  c:/01work/opengamelist/src/opengamelistwebapp/node_modules/@angular/core/src/linker/ng_module_factory_loader.d.ts(14,34): error ts2304: cannot find name 'promise'.  c:/01work/opengamelist/src/opengamelistwebapp/node_modules/@angular/core/src/linker/system_js_ng_module_factory_loader.d.ts(28,25): error ts2304: cannot find name 'promise'.  c:/01work/opengamelist/src/opengamelistwebapp/node_modules/@angular/http/src/headers.d.ts(45,59): error ts2304: cannot find name 'map'.  c:/01work/opengamelist/src/opengamelistwebapp/node_modules/@angular/http/src/url_search_params.d.ts(46,16): error ts2304: cannot find name 'map'.  c:/01work/opengamelist/src/opengamelistwebapp/node_modules/@angular/platform-browser-dynamic/src/resource_loader/resource_loader_impl.d.ts(10,23): error ts2304: cannot find name 'promise'.  c:/01work/opengamelist/src/opengamelistwebapp/node_modules/@angular/platform-browser/src/browser/browser_adapter.d.ts(79,33): error ts2304: cannot find name 'map'.  c:/01work/opengamelist/src/opengamelistwebapp/node_modules/@angular/platform-browser/src/dom/dom_adapter.d.ts(97,42): error ts2304: cannot find name 'map'.  c:/01work/opengamelist/src/opengamelistwebapp/node_modules/@angular/platform-browser/src/dom/dom_renderer.d.ts(18,37): error ts2304: cannot find name 'map'.  c:/01work/opengamelist/src/opengamelistwebapp/node_modules/@angular/platform-browser/src/facade/collection.d.ts(2,25): error ts2304: cannot find name 'mapconstructor'.  c:/01work/opengamelist/src/opengamelistwebapp/node_modules/@angular/platform-browser/src/facade/collection.d.ts(3,25): error ts2304: cannot find name 'setconstructor'.  c:/01work/opengamelist/src/opengamelistwebapp/node_modules/@angular/platform-browser/src/facade/collection.d.ts(5,27): error ts2304: cannot find name 'map'.  c:/01work/opengamelist/src/opengamelistwebapp/node_modules/@angular/platform-browser/src/facade/collection.d.ts(5,39): error ts2304: cannot find name 'map'.  c:/01work/opengamelist/src/opengamelistwebapp/node_modules/@angular/platform-browser/src/facade/collection.d.ts(8,9): error ts2304: cannot find name 'map'.  c:/01work/opengamelist/src/opengamelistwebapp/node_modules/@angular/platform-browser/src/facade/collection.d.ts(9,30): error ts2304: cannot find name 'map'.  c:/01work/opengamelist/src/opengamelistwebapp/node_modules/@angular/platform-browser/src/facade/collection.d.ts(12,43): error ts2304: cannot find name 'map'.  c:/01work/opengamelist/src/opengamelistwebapp/node_modules/@angular/platform-browser/src/facade/collection.d.ts(13,27): error ts2304: cannot find name 'map'.  c:/01work/opengamelist/src/opengamelistwebapp/node_modules/@angular/platform-browser/src/facade/collection.d.ts(15,23): error ts2304: cannot find name 'map'.  c:/01work/opengamelist/src/opengamelistwebapp/node_modules/@angular/platform-browser/src/facade/collection.d.ts(16,25): error ts2304: cannot find name 'map'.  c:/01work/opengamelist/src/opengamelistwebapp/node_modules/@angular/platform-browser/src/facade/collection.d.ts(101,41): error ts2304: cannot find name 'set'.  c:/01work/opengamelist/src/opengamelistwebapp/node_modules/@angular/platform-browser/src/facade/collection.d.ts(102,22): error ts2304: cannot find name 'set'.  c:/01work/opengamelist/src/opengamelistwebapp/node_modules/@angular/platform-browser/src/facade/collection.d.ts(103,25): error ts2304: cannot find name 'set'.  c:/01work/opengamelist/src/opengamelistwebapp/node_modules/rxjs/observable.d.ts(68,60): error ts2304: cannot find name 'promise'.  c:/01work/opengamelist/src/opengamelistwebapp/node_modules/rxjs/observable.d.ts(68,70): error ts2304: cannot find name 'promise'.  c:/01work/opengamelist/src/opengamelistwebapp/node_modules/rxjs/observable/promiseobservable.d.ts(40,31): error ts2304: cannot find name 'promise'.  c:/01work/opengamelist/src/opengamelistwebapp/node_modules/rxjs/observable/promiseobservable.d.ts(41,26): error ts2304: cannot find name 'promise'.  c:/01work/opengamelist/src/opengamelistwebapp/node_modules/rxjs/operator/topromise.d.ts(8,60): error ts2304: cannot find name 'promise'.  c:/01work/opengamelist/src/opengamelistwebapp/node_modules/rxjs/operator/topromise.d.ts(9,79): error ts2304: cannot find name 'promise'.  c:/01work/opengamelist/src/opengamelistwebapp/node_modules/rxjs/operator/topromise.d.ts(9,89): error ts2304: cannot find name 'promise'.  [11:40:03] typescript: 76 semantic errors  [11:40:03] typescript: emit succeeded (with errors)  [11:40:03] finished 'js' after 6.2 s  [11:40:03] finished 'app' after 5.69 s  [11:40:03] starting 'default'...  [11:40:03] finished 'default' after 8.93 μs

you didn't include information related typescript version, i'll assume it's ts >=2.0.

in case, need include @types/core-js in package.json. in addition that, need point core-js types in tsconfig.json (or either tsconfig-aot.json)

"typeroots": [ "./node_modules/@types" ]

if specify types manually, then...

"typeroots": [ "./node_modules/@types" ], "types": [ "core-js", ...(other types manually specify) ]

hope helps.


Comments

Popular posts from this blog

php - How to display all orders for a single product showing the most recent first? Woocommerce -

asp.net - How to correctly use QUERY_STRING in ISAPI rewrite? -

angularjs - How restrict admin panel using in backend laravel and admin panel on angular? -