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

4
  • The last version of the CLI is not 1.7.3 but 7.2.0 Commented Jan 9, 2019 at 12:35
  • try install stable version of node.js. you use beta version of node and latest AngularCli is 7.2.0 so try this Commented Jan 9, 2019 at 12:35
  • Yes, your angular/cli version is outdated. run : npm uninstall -g @angular/cli npm cache verify npm install -g @angular/cli@latest Commented Jan 9, 2019 at 12:35
  • try uninstalling the CLI first, then use install. Commented Jan 9, 2019 at 12:37

2 Answers 2

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

Sign up to request clarification or add additional context in comments.

Comments

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

1 Comment

Do one thing uninstall previous version of cli and install latest one

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.