【问题标题】:ctorParameters.map is not a function errorctorParameters.map 不是函数错误
【发布时间】:2017-06-03 03:35:29
【问题描述】:

我只是从 bitbucket 安装 angular2cli。在 npm install、ng build 和 ng serve 之后,转到 localhost:4200 我得到这个错误

Uncaught TypeError: ctorParameters.map is not a function
    at ReflectionCapabilities.parameters (http://localhost:4200/main.bundle.js:44436:45)
    at Reflector.parameters (http://localhost:4200/main.bundle.js:44570:44)
    at CompileMetadataResolver.getDependenciesMetadata (http://localhost:4200/main.bundle.js:25124:54)
    at CompileMetadataResolver.getTypeMetadata (http://localhost:4200/main.bundle.js:25089:26)
    at CompileMetadataResolver.getDirectiveMetadata (http://localhost:4200/main.bundle.js:24864:28)
    at http://localhost:4200/main.bundle.js:24933:49
    at Array.forEach (native)
    at CompileMetadataResolver.getNgModuleMetadata (http://localhost:4200/main.bundle.js:24926:44)
    at http://localhost:4200/main.bundle.js:24914:50
    at Array.forEach (native)

谁能告诉我什么问题?我更新了新的,但仍然有这个问题,我降级到 angular-cli@1.0.0-beta.14 似乎根本不起作用。谷歌它并阅读了很多“解决方案”不起作用。

【问题讨论】:

  • 这是一个新问题,可能依赖项之一需要更新的angular-cli 版本。尝试更新到angular-cli@1.0.0-beta.25

标签: node.js angular angular2-cli


【解决方案1】:

我今天遇到了同样的错误,这就是我所做的:

  • 降级我的节点版本(到节点:4.3.2)
  • 运行 npm install -g npm。 (获取最新的 npm 版本)
  • 更新我的 Angular 版本如下:
"@angular/common": "2.4.1",
"@angular/compiler": "2.4.1",
"@angular/core": "2.4.1",
"@angular/forms": "2.4.1",
"@angular/http": "2.4.1",
"@angular/platform-browser": "2.4.1",
"@angular/platform-browser-dynamic": "2.4.1",
"@angular/platform-server": "2.4.1",
"@angular/router": "3.4.1",
"rxjs": "5.0.1",
"zone.js": "^0.7.2"
  • 很多人都有同样的问题,也许here你可以找到更多关于这个问题的信息。希望能帮助到你。

【讨论】:

    猜你喜欢
    • 2017-07-20
    • 2023-03-17
    • 2017-05-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-10-23
    • 2013-01-04
    • 1970-01-01
    相关资源
    最近更新 更多