angular-cli: ng -v error reflect-metadata after update cli version beta.20-1

Please provide us with the following information:

OS?

ubuntu 14.04

Versions.

angular-cli@1.0.0-beta.20-1 node 7.0.0 npm 3.10.9

Repro steps.

update latest cli

npm rm -g angular-cli
npm i -g angular-cli

then

ng -v

have done the same with npm cache clean, same error

The log given by the failure.

$ ng -v
Cannot find module 'reflect-metadata'
Error: Cannot find module 'reflect-metadata'

Mention any other details that might be useful.

Also when doing npm ls -g --depth=0 shows

npm ERR! peer dep missing: @angular/compiler-cli@^2.1.0, required by @ngtools/webpack@1.1.7
npm ERR! peer dep missing: @angular/core@^2.0.0, required by @ngtools/webpack@1.1.7
npm ERR! peer dep missing: reflect-metadata@^0.1.8, required by @ngtools/webpack@1.1.7

didn’t happen in previous version.


Thanks! We’ll be in touch soon.

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 4
  • Comments: 17 (4 by maintainers)

Commits related to this issue

Most upvoted comments

Same here 😦 angular-cli: v1.0.0-beta.20-1 OS: Mac os 10.10.1 nodejs: 7.0.0 npm: 3.10.9

Can’t even run ng version … same error angular-cli: v1.0.0-beta.20-1 OS: Windows 7 x64 nodejs: 5.12.0

Got the same error with same stack trace angular-cli: v1.0.0-beta.20-1 OS: macOS Sierra nodejs: 6.7.0

solve this by rolling back to the last usable version 1.0.0-beta.19-3 npm i -g angular-cli@1.0.0-beta.19-3

"ng " doesn’t run anymore!, I get the same error event after installing it globally, can’t event run “ng -v”!

angular-cli@1.0.0-beta.20-1 OS: Kubuntu 16.04 node: v6.9.1 npm: 3.10.8

Alright this is fixed and published. Sorry all for the inconvenience.

A temporary fix that worked for me: Add these to your package.json (change the version of @angular/compiler-cli to the exact same version you have for @angular/core)

 "@angular/compiler-cli": "2.2.0",
 "reflect-metadata": "^0.1.8"

And for running ng ... don’t use your global angular-cli , instead add it to your package.json and run it with npm (so it’s gonna use your local angular-cli)

 "scripts": {
    ...
    "build-my-app": "ng build --prod --aot --xyz"
 },

and to run it

 npm run build-my-app