【问题标题】:error in webpack compilingwebpack编译错误
【发布时间】:2017-08-21 22:39:04
【问题描述】:

我在尝试运行 angular2 项目时出错。它发生在从带有 ubuntu 的 PC 切换到 MacOS X 之后。节点版本:7.7.4,npm 版本:4.1.2。我正在运行npm webpack-dev-server --inline --progress --watch --port 8180,然后我得到了以下信息:

WARNING in ./~/@angular/core/src/linker/system_js_ng_module_factory_loader.js
69:15-36 Critical dependency: the request of a dependency is an expression

WARNING in ./~/@angular/core/src/linker/system_js_ng_module_factory_loader.js
85:15-102 Critical dependency: the request of a dependency is an expression

WARNING in ./~/angular2-focus/~/@angular/core/@angular/core.es5.js
5889:15-36 Critical dependency: the request of a dependency is an expression

WARNING in ./~/angular2-focus/~/@angular/core/@angular/core.es5.js
5905:15-102 Critical dependency: the request of a dependency is an expression

ERROR in [default] /Users/user/Documents/Java/WORK/mediahelper/media-helper/src/main/web/node_modules/angular2-focus/node_modules/@angular/core/src/animation/animation_metadata_wrapped.d.ts:12:32 
Initializers are not allowed in ambient contexts.

[...]

ERROR in [default] /Users/user/node_modules/@types/core-js/index.d.ts:651:4 
All declarations of 'prototype' must have identical modifiers.

ERROR in [default] /Users/user/node_modules/@types/core-js/index.d.ts:666:4 
All declarations of 'prototype' must have identical modifiers.

ERROR in [default] /Users/user/node_modules/@types/core-js/index.d.ts:680:4 
All declarations of 'prototype' must have identical modifiers.

ERROR in [default] /Users/user/node_modules/@types/core-js/index.d.ts:692:4 
All declarations of 'value' must have identical modifiers.

ERROR in [default] /Users/user/node_modules/@types/core-js/index.d.ts:804:4 
All declarations of 'prototype' must have identical modifiers.

【问题讨论】:

    标签: node.js angular npm npm-install


    【解决方案1】:

    刚刚将我的宠物项目更新为@angular4 并收到了类似的警告

    angular/core.es5.js 5889:15-36 Critical dependency: 
    the request of a dependency is an expression
    

    改变你的 webpack.conf.js

    from: /angular(\|/)core(\|/)(esm(\|/)src|src)(\|/)linker/
    to:   /angular(\|/)core(\|/)@angular/
    

    reddit 帖子链接:https://www.reddit.com/r/Angular2/comments/6160c2/angular_400_now_available/dfci3gm/

    【讨论】:

      猜你喜欢
      • 2016-10-20
      • 2016-07-01
      • 1970-01-01
      • 2020-10-31
      • 1970-01-01
      • 2018-01-28
      • 2020-09-08
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多