ctorParameters.map is not a function error

868 Views Asked by At

I just install angular2cli from bitbucket. After npm install, ng build and ng serve, and go to localhost:4200 I get this error

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)

Anyone can tell me what problem? i updated the new one but still have this issue and I downgrade to [email protected] seems not working at all. Google it and read a lot of "solution" does not work.

1

There are 1 best solutions below

0
On

I got the same error today, here's what i did:

  • Downgrade my node version (to node:4.3.2)
  • Run npm install -g npm. (To get the latest npm version)
  • Update my Angular versions as follow:
"@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"
  • A lot of people have the same issue, maybe here you can find more info 'bout this issue. Hope it helps.