0

I start a new project with Angular, so decided to upgrade my global packages.

I run Windows10. Command ng -v returns me:

Angular CLI: 6.0.8
Node: 8.12.0
OS: win32 x64

At the moment of writing this, the latest stable version is 6.2.4, as npmjs.com says.

In order to upgrade to the latest version I run:

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

All commands complete successfully, and now I checking ng -v but it is still 6.0.8. I would expect it to be 6.2.4.

What I'm doing wrong?

Roma Kostelnyy
  • 183
  • 1
  • 12

2 Answers2

2

Run npm upgrade -g @angular/cli should work properly.

billyjov
  • 2,778
  • 19
  • 35
  • Wow, it worked. Probably some caching issue occurred. What I was applying is an answer for this question: https://stackoverflow.com/questions/43931986/how-to-upgrade-angular-cli-to-the-latest-version. It didn't work for me. Thanks @billyjov – Roma Kostelnyy Oct 09 '18 at 18:58
0

You might be running this command from a directory which might have a node_modules folder in it.

For example, if you inside of any angular project directory then ng is local not the global one.

Please try running this command from some directory.

Vivek Kumar
  • 4,822
  • 8
  • 51
  • 85