gpt4 book ai didi

node.js - webpack 编译出错

转载 作者:太空狗 更新时间:2023-10-29 19:29:35 26 4
gpt4 key购买 nike

我在尝试运行 angular2 项目时遇到错误。它发生在从带有 ubuntu 的 PC 切换到 MacOS X 之后。 Node 版本: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.

最佳答案

刚刚将我的宠物项目更新为@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/

关于node.js - webpack 编译出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43076615/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com