question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ng --version reports wrong version number

See original GitHub issue

After installing angular-cli to the latest, the --version command returns version 1.0.0-beta.30 instead of 1.0.0-rc.0

OS?

Windows 10

Versions.

This is what is at issue.

Repro steps.

npm uninstall -g @angular/cli npm cache clean npm install -g @angular/cli@latest

The log given by the failure.

-- @angular/cli@1.0.0-rc.0 +-- @angular/compiler@2.4.8 +-- @angular/compiler-cli@2.4.8 ... PS C:\Projects> ng --version @angular/cli: 1.0.0-beta.30 node: 6.9.5 os: win32 x64

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
filipesilvacommented, Mar 2, 2017

@bklik I know there are cases in windows where npm global installs get out of sync and it really sucks to figure out where the leftover modules are. I think it might be related to nvm.

It’s not a CLI issue though… the CLI can’t really control that sort of stuff. So in that sense it’s not something I want to leave open in this issue tracker.

1reaction
bklikcommented, Mar 2, 2017

Even after running npm uninstall -g @angular/cli and npm uninstall -g angular-cli then reinstalling, I found that it still didn’t work.

I tried an ng -v after uninstalling both, and surprisingly found that it would still output the beta version of angular-cli. I looked in the C:\Program Files\nodejs\node_modules and found a folder called angular-cli. After removing it, and re-installing angular-cli, angular-cli would fail to run afterward.

I gave up, uninstalled nodejs. Deleted C:\Program Files\nodejs and deleted all npm and npm-cache folders from my AppData. Reinstall nodejs, and ran npm install -g @angular/cli@latest.

I’m now properly receiving the correct version:

PS C:\WINDOWS\system32> ng -v
    _                      _                 ____ _     ___
   / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
  / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
 / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
/_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
               |___/
@angular/cli: 1.0.0-rc.0
node: 6.10.0
os: win32 x64

Not a real work around. I think the answer lies in where that ‘angular-cli’ folder in ‘nodejs/node_modules’ came from, and how to properly remove it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

global `ng version` shows errors instead of version numbers
Changing directory to one of my project that had node_modules, then ng version showing the installed package versions correctly.
Read more >
Ng V Still Showing Older Version Number After Updating To ...
Ng V Still Showing Older Version Number After Updating To Latest Angular Cli ... to false and is no longer required to report...
Read more >
ng --version shows <error> for Angular version number and ...
Coding example for the question ng --version shows for Angular version number and some packages-angular.js.
Read more >
ng update - Angular
To update to the next beta or pre-release version, use the --next option. ... boolean, false ... Shows a help message for this...
Read more >
Windows Package Manager - Salt Project Documentation
Masterless minion: C:\salt\srv\salt\win\repo-ng ( salt://win/repo-ng ) ... Default is False ... The exact version number as shown in Add/Remove Programs.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found