Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ng -v error reflect-metadata after update cli version beta.20-1 #3148

Closed
antonybudianto7 opened this issue Nov 16, 2016 · 17 comments · Fixed by #3152
Closed

ng -v error reflect-metadata after update cli version beta.20-1 #3148

antonybudianto7 opened this issue Nov 16, 2016 · 17 comments · Fixed by #3152

Comments

@antonybudianto7
Copy link

antonybudianto7 commented Nov 16, 2016

Please provide us with the following information:

OS?

ubuntu 14.04

Versions.

[email protected]
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/[email protected]
npm ERR! peer dep missing: @angular/core@^2.0.0, required by @ngtools/[email protected]
npm ERR! peer dep missing: reflect-metadata@^0.1.8, required by @ngtools/[email protected]

didn't happen in previous version.


Thanks! We'll be in touch soon.

@antonybudianto7
Copy link
Author

full stack traces

$ ng -v
Cannot find module 'reflect-metadata'
Error: Cannot find module 'reflect-metadata'
    at Function.Module._resolveFilename (module.js:472:15)
    at Function.Module._load (module.js:420:25)
    at Module.require (module.js:500:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/home/antony-budianto/.nvm/versions/node/v7.0.0/lib/node_modules/angular-cli/node_modules/@ngtools/webpack/src/index.js:5:1)
    at Module._compile (module.js:573:32)
    at Object.Module._extensions..js (module.js:582:10)
    at Module.load (module.js:490:32)
    at tryModuleLoad (module.js:449:12)
    at Function.Module._load (module.js:441:3)
    at Module.require (module.js:500:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/home/antony-budianto/.nvm/versions/node/v7.0.0/lib/node_modules/angular-cli/models/webpack-build-typescript.js:5:17)
    at Module._compile (module.js:573:32)
    at Object.Module._extensions..js (module.js:582:10)
    at Module.load (module.js:490:32)
    at tryModuleLoad (module.js:449:12)
    at Function.Module._load (module.js:441:3)
    at Module.require (module.js:500:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/home/antony-budianto/.nvm/versions/node/v7.0.0/lib/node_modules/angular-cli/models/webpack-config.js:2:34)
    at Module._compile (module.js:573:32)
    at Object.Module._extensions..js (module.js:582:10)
    at Module.load (module.js:490:32)
    at tryModuleLoad (module.js:449:12)
    at Function.Module._load (module.js:441:3)
    at Module.require (module.js:500:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/home/antony-budianto/.nvm/versions/node/v7.0.0/lib/node_modules/angular-cli/tasks/build-webpack.js:6:24)
    at Module._compile (module.js:573:32)
    at Object.Module._extensions..js (module.js:582:10)
    at Module.load (module.js:490:32)
    at tryModuleLoad (module.js:449:12)
    at Function.Module._load (module.js:441:3)
    at Module.require (module.js:500:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/home/antony-budianto/.nvm/versions/node/v7.0.0/lib/node_modules/angular-cli/commands/build.js:3:23)
    at Module._compile (module.js:573:32)
    at Object.Module._extensions..js (module.js:582:10)
    at Module.load (module.js:490:32)
    at tryModuleLoad (module.js:449:12)
    at Function.Module._load (module.js:441:3)
    at Module.require (module.js:500:17)
    at require (internal/module.js:20:19)
    at Class.includedCommands (/home/antony-budianto/.nvm/versions/node/v7.0.0/lib/node_modules/angular-cli/addon/index.js:21:16)
    at /home/antony-budianto/.nvm/versions/node/v7.0.0/lib/node_modules/angular-cli/angular-cli/lib/models/project.js:392:61
    at Array.forEach (native)
    at Project.addonCommands (/home/antony-budianto/.nvm/versions/node/v7.0.0/lib/node_modules/angular-cli/angular-cli/lib/models/project.js:391:15)
    at Project.eachAddonCommand (/home/antony-budianto/.nvm/versions/node/v7.0.0/lib/node_modules/angular-cli/angular-cli/lib/models/project.js:426:30)
    at module.exports (/home/antony-budianto/.nvm/versions/node/v7.0.0/lib/node_modules/angular-cli/angular-cli/lib/cli/lookup-command.js:33:13)
    at CLI.<anonymous> (/home/antony-budianto/.nvm/versions/node/v7.0.0/lib/node_modules/angular-cli/angular-cli/lib/cli/cli.js:34:26)
    at tryCatch (/home/antony-budianto/.nvm/versions/node/v7.0.0/lib/node_modules/angular-cli/node_modules/rsvp/dist/rsvp.js:538:12)
    at invokeCallback (/home/antony-budianto/.nvm/versions/node/v7.0.0/lib/node_modules/angular-cli/node_modules/rsvp/dist/rsvp.js:553:13)
    at publish (/home/antony-budianto/.nvm/versions/node/v7.0.0/lib/node_modules/angular-cli/node_modules/rsvp/dist/rsvp.js:521:7)
    at flush (/home/antony-budianto/.nvm/versions/node/v7.0.0/lib/node_modules/angular-cli/node_modules/rsvp/dist/rsvp.js:2373:5)
    at _combinedTickCallback (internal/process/next_tick.js:67:7)
    at process._tickCallback (internal/process/next_tick.js:98:9)

@jackywang615
Copy link

jackywang615 commented Nov 16, 2016

The same error.
angular-cli: v1.0.0-beta.20-1
OS: windows 10 x64
nodejs: 7.0.0
qq 20161116114528

@coryrylan
Copy link
Contributor

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

@b4youleap
Copy link

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

@mcourville
Copy link

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

@monfa-red
Copy link

monfa-red commented Nov 16, 2016

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

[email protected]
OS: Kubuntu 16.04
node: v6.9.1
npm: 3.10.8

@evrins
Copy link

evrins commented Nov 16, 2016

Same problem
[email protected]
OS: Mac OS 10.12.1 (16B2555)
node: v7.1.0
npm: 4.0.2

@monfa-red
Copy link

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

@koujala
Copy link

koujala commented Nov 16, 2016

I managed to get this working this way
npm i -g reflect-metadata

However I installed angular-cli locally ( just like @monfa-red )
npm i angular-cli

Followed by these
npm i reflect-metadata
npm i zone.js@^0.6.21
npm i -g [email protected]
npm i @angular/core
npm i @angular/compiler-cli
npm i @angular/compiler

Followed by ng -v
angular-cli: 1.0.0-beta.20-1
node: 6.9.1
os: win32 x64

@evrins
Copy link

evrins commented Nov 16, 2016

solve this by rolling back to the last usable version 1.0.0-beta.19-3
npm i -g [email protected]

@harilalinapp
Copy link

Same issue. I tried to update my application to 20-1 and its breaking. So i rolled back to 19-3
I think it's related to some dependency.

@hansl
Copy link
Contributor

hansl commented Nov 16, 2016

Looking into it. I'm going to release 20-2 soon. Stay tuned.

@hansl
Copy link
Contributor

hansl commented Nov 16, 2016

Beta 20-1 is released as experimental. Latest tag as been set back to 19-3 while we see if this one is good.

@hansl
Copy link
Contributor

hansl commented Nov 16, 2016

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

@harilalinapp
Copy link

Is it the latest?

@tonymedrano
Copy link

Hi there, my experimental solution in Windows for now is:
-Got to directory: C:\Users"Your User"\AppData\Roaming\npm\node_modules\angular-cli

  • npm install reflect-metadata
  • npm install portfinder

It´s working for me and apply for any platform if you can access the final path as above.
Hope this help.

Mischi pushed a commit to BROCKHAUS-AG/angular-cli that referenced this issue Nov 19, 2016
MRHarrison pushed a commit to MRHarrison/angular-cli that referenced this issue Feb 9, 2017
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.