3

I have a strange problem with angular/cli (WINDOWS). A year ago, I installed angular on my computer and I created a new project, all fine. I've been updating angular when a new version came out (now I'm on v7). Today I have to create a new project. If I run the ng new my-new-project --skip-install command, everything works, but an angular project 5 is created:

enter image description here

Which contains the following:

enter image description here

I try to update my global CLI version, doing this npm install -g @angular/cli@latest

enter image description here

After doing this, I execute ng --version and I see this :

enter image description here

Weird, but it's fine. If I try to generate a new project, the same thing that I explained before happens. Why did this happen? Is there any way to solve it? Thanks in advance.

EDIT

My node version is 11.6.0 :

enter image description here

I tried as admin:

  • npm uninstall -g @angular/cli

  • npm cache verify

  • npm install -g @angular/cli@latest

And the result is the same. Even restarting, it still does not work..

enter image description here

mruanova
  • 6,351
  • 6
  • 37
  • 55
Aw3same
  • 930
  • 4
  • 13
  • 38

2 Answers2

3

Finally, I found the problem. In my C:\ directory there was a folder called node_modules, which contain the angular/cli version 1.7.3. That's why my pc didn't recognize the new version. Deleting this folder, the result is:

enter image description here

Thanks everyone for your time.

P.S:: I found the problem doing this :

enter image description here

Aw3same
  • 930
  • 4
  • 13
  • 38
0

Please check your node.js version first.
Maybe your system takes some time to update the CLI version.
Restart your computer and run ng --v command

Hypenate
  • 1,907
  • 3
  • 22
  • 38
Sneha Pawar
  • 1,097
  • 6
  • 14