【发布时间】:2017-06-20 04:36:20
【问题描述】:
我使用这些命令创建了一个全新的 angular 2 应用程序:
ng init
ng server
我得到这个错误输出:
chunk {1} styles.bundle.js, styles.bundle.map (styles) 9.96 kB {3} [initial] [rendered]
chunk {2} vendor.bundle.js, vendor.bundle.map (vendor) 2.65 MB [initial] [rendered]
chunk {3} inline.bundle.js, inline.bundle.map (inline) 0 bytes [entry] [rendered]
ERROR in ./~/@angular/core/src/util/decorators.js
Module parse failed: /Users/nikolaschou/Dev/coziv/sandbox01/blockhowapp/temp/node_modules/@angular/core/src/util/decorators.js Parenthesized pattern (156:12)
You may need an appropriate loader to handle this file type.
|if (clsDef.hasOwnProperty('extends')) {
| if (typeof clsDef.extends === 'function') {
谁能解释我为什么会收到这个错误?我看到很多类似的错误报告,但不完全是这种变化。
更多详情
我可以说 ng serve 在同一台机器上的另一个 angular-2 应用程序文件夹中运行良好,我已经比较了这两个文件夹,但没有发现任何可以解释这种行为的明显差异。
我使用带有最新 iOS 的 Mac,这是 ng --version 的输出:
angular-cli: 1.0.0-beta.26
node: 6.6.0
os: darwin x64
@angular/common: 2.4.5
@angular/compiler: 2.4.5
@angular/core: 2.4.5
@angular/forms: 2.4.5
@angular/http: 2.4.5
@angular/platform-browser: 2.4.5
@angular/platform-browser-dynamic: 2.4.5
@angular/router: 3.4.5
@angular/compiler-cli: 2.4.5
【问题讨论】:
-
你使用的是哪个版本的 webpack?我们在 webpack/backbone 设置中遇到了类似的问题。
-
我们也刚刚开始看到这一点。使用 webpack 2.2.0。我猜有人的传递依赖升级并且正在破坏事情..
-
最新的@angular/cli beta.29,webpack 2.2.0 - 同样的东西
-
github相关问题:github.com/angular/angular-cli/issues/4378
-
我想可能是npmjs.com/package/acorn ?最近从 4.0.4 更新到 4.0.5 是的。在此处查看此问题:github.com/ternjs/acorn/issues/502