加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

angular – 使用Webpack时出错

发布时间:2020-12-17 10:17:48 所属栏目:安全 来源:网络整理
导读:我正在尝试按照 this tutorial学习webpack. 当我跑下午开始时,我得到70个错误,如下所示. $npm start angular2-webpack@1.0.0 start /Users/angular-webpak[at-loader] Using typescript@2.0.10 from typescript and "tsconfig.json" from /Users/angular-web
我正在尝试按照 this tutorial学习webpack.

当我跑下午开始时,我得到70个错误,如下所示.

$npm start

> angular2-webpack@1.0.0 start /Users/angular-webpak

[at-loader] Using typescript@2.0.10 from typescript and "tsconfig.json" from /Users/angular-webpak/src/tsconfig.json.

[at-loader] Checking finished with 70 errors
...

ERROR in [at-loader] node_modules/@types/jasmine/index.d.ts:39:52 
    TS1005: '=' expected.
ERROR in [at-loader] node_modules/@angular/common/src/directives/ng_class.d.ts:48:34 
    TS2304: Cannot find name 'Set'.
ERROR in [at-loader] node_modules/@angular/common/src/pipes/async_pipe.d.ts:44:38 
    TS2304: Cannot find name 'Promise'.
ERROR in [at-loader] node_modules/@angular/compiler/src/aot/compiler.d.ts:32:38 
    TS2304: Cannot find name 'Promise'.
ERROR in [at-loader] node_modules/@angular/compiler/src/aot/compiler.d.ts:44:32 
    TS2304: Cannot find name 'Map'.
ERROR in [at-loader] node_modules/@angular/compiler/src/aot/compiler_host.d.ts:20:33 
    TS2304: Cannot find name 'Promise'.
ERROR in [at-loader] node_modules/@angular/compiler/src/compile_metadata.d.ts:342:20 
    TS2304: Cannot find name 'Set'.
ERROR in [at-loader] node_modules/@angular/compiler/src/compile_metadata.d.ts:344:28 
    TS2304: Cannot find name 'Set'.
ERROR in [at-loader] node_modules/@angular/compiler/src/compile_metadata.d.ts:346:15 
    TS2304: Cannot find name 'Set'.
ERROR in [at-loader] node_modules/@angular/compiler/src/compile_metadata.d.ts:348:23 
    TS2304: Cannot find name 'Set'.
ERROR in [at-loader] node_modules/@angular/compiler/src/compile_metadata.d.ts:350:17 
    TS2304: Cannot find name 'Set'.
ERROR in [at-loader] node_modules/@angular/compiler/src/compile_metadata.d.ts:352:25 
    TS2304: Cannot find name 'Set'.
ERROR in [at-loader] node_modules/@angular/compiler/src/directive_normalizer.d.ts:38:72 
    TS2304: Cannot find name 'Promise'.
ERROR in [at-loader] node_modules/@angular/compiler/src/directive_normalizer.d.ts:40:74 
    TS2304: Cannot find name 'Promise'.
ERROR in [at-loader] node_modules/@angular/compiler/src/i18n/extractor.d.ts:14:33 
    TS2304: Cannot find name 'Promise'.
ERROR in [at-loader] node_modules/@angular/compiler/src/i18n/extractor.d.ts:22:35 
    TS2304: Cannot find name 'Promise'.
ERROR in [at-loader] node_modules/@angular/compiler/src/jit/compiler.d.ts:44:49 
    TS2304: Cannot find name 'Promise'.
ERROR in [at-loader] node_modules/@angular/compiler/src/jit/compiler.d.ts:46:65 
    TS2304: Cannot find name 'Promise'.
ERROR in [at-loader] node_modules/@angular/compiler/src/metadata_resolver.d.ts:58:104 
    TS2304: Cannot find name 'Promise'.
ERROR in [at-loader] node_modules/@angular/compiler/src/output/output_ast.d.ts:433:63 
    TS2304: Cannot find name 'Set'.
ERROR in [at-loader] node_modules/@angular/compiler/src/resource_loader.d.ts:13:23 
    TS2304: Cannot find name 'Promise'.
ERROR in [at-loader] node_modules/@angular/compiler/src/util.d.ts:33:18 
    TS2304: Cannot find name 'Promise'.
ERROR in [at-loader] node_modules/@angular/compiler/src/util.d.ts:34:46 
    TS2304: Cannot find name 'Promise'.
<snipped several similar errors>
ERROR in [at-loader] node_modules/@angular/core/src/change_detection/differs/default_keyvalue_differ.d.ts:24:15 
    TS2304: Cannot find name 'Map'.
ERROR in [at-loader] node_modules/@angular/core/src/change_detection/differs/default_keyvalue_differ.d.ts:28:16 
    TS2304: Cannot find name 'Map'.
<snipped several similar errors>
ERROR in [at-loader] node_modules/@angular/platform-browser/src/dom/shared_styles_host.d.ts:11:30 
    TS2304: Cannot find name 'Set'.
ERROR in [at-loader] node_modules/@angular/platform-browser/src/dom/shared_styles_host.d.ts:22:30 
    TS2304: Cannot find name 'Set'.
ERROR in [at-loader] node_modules/@angular/router/src/config.d.ts:307:85 
    TS2304: Cannot find name 'Promise'.
ERROR in [at-loader] node_modules/@angular/router/src/interfaces.d.ts:78:99 
    TS2304: Cannot find name 'Promise'.
ERROR in [at-loader] node_modules/@angular/router/src/interfaces.d.ts:157:109 
    TS2304: Cannot find name 'Promise'.
ERROR in [at-loader] node_modules/@angular/router/src/interfaces.d.ts:227:115 
    TS2304: Cannot find name 'Promise'.
ERROR in [at-loader] node_modules/@angular/router/src/interfaces.d.ts:297:89 
    TS2304: Cannot find name 'Promise'.
ERROR in [at-loader] node_modules/@angular/router/src/interfaces.d.ts:367:50 
    TS2304: Cannot find name 'Promise'.
ERROR in [at-loader] node_modules/@angular/router/src/router.d.ts:392:70 
    TS2304: Cannot find name 'Promise'.
ERROR in [at-loader] node_modules/@angular/router/src/router.d.ts:414:59 
    TS2304: Cannot find name 'Promise'.
ERROR in [at-loader] node_modules/@angular/router/src/utils/collection.d.ts:36:79 
    TS2304: Cannot find name 'Promise'.
ERROR in [at-loader] node_modules/@types/jasmine/index.d.ts:39:38 
    TS2371: A parameter initializer is only allowed in a function or constructor implementation.
ERROR in [at-loader] node_modules/@types/jasmine/index.d.ts:39:46 
    TS2304: Cannot find name 'keyof'.
ERROR in [at-loader] node_modules/rxjs/Observable.d.ts:68:60 
    TS2304: Cannot find name 'Promise'.
ERROR in [at-loader] node_modules/rxjs/Observable.d.ts:68:70 
    TS2304: Cannot find name 'Promise'.
ERROR in [at-loader] node_modules/rxjs/observable/PromiSEObservable.d.ts:40:31 
    TS2304: Cannot find name 'Promise'.
ERROR in [at-loader] node_modules/rxjs/observable/PromiSEObservable.d.ts:41:26 
    TS2304: Cannot find name 'Promise'.
ERROR in [at-loader] node_modules/rxjs/operator/toPromise.d.ts:2:60 
    TS2304: Cannot find name 'Promise'.
ERROR in [at-loader] node_modules/rxjs/operator/toPromise.d.ts:3:79 
    TS2304: Cannot find name 'Promise'.
ERROR in [at-loader] node_modules/rxjs/operator/toPromise.d.ts:3:89 
    TS2304: Cannot find name 'Promise'.
ERROR in [at-loader] src/app/app.component.ts:8:14 
    TS1219: Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option to remove this warning.
ERROR in [at-loader] src/app/app.module.ts:13:14 
    TS1219: Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option to remove this warning.
Child html-webpack-plugin for "index.html":
    chunk    {0} index.html 299 bytes [entry] [rendered]
Child extract-text-webpack-plugin:
    chunk    {0} extract-text-webpack-plugin-output-filename 1.95 kB [entry] [rendered]
webpack: Failed to compile.
修复程序在这里 https://github.com/angular/angular.io/pull/3233/commits/8e886fc2710acadd749139c2172519de254b849c

你必须修改webpack.common.js

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读