angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

Upgrade Angular-CLI on Windows 10 with beta.17 fails to run

Open lekova opened this issue 10 years ago • 7 comments

Tried to do the upgrade from beta.10 to beta.14 described in the wiki page and got a problem where the installation process is successful however I cannot run ng --version.

After couple of days I tried again (we are at beta.17) so I followed the same steps

  • node update
  • npm uninstall angular-cli -g
  • npm cache clean
  • npm install angular-cli@latest -g

I get the same problem as before: angular-cli windows

lekova avatar Oct 10 '16 15:10 lekova

Maybe you missed version property in angular-cli.json file. It should be updated to 1.0.0-beta.14 or 1.0.0-beta.17 as well.

dzonatan avatar Oct 10 '16 16:10 dzonatan

Wait, is that inside the project? Since the upgrade process requires you to make a new project, you should do it outside of the existing project.

filipesilva avatar Oct 10 '16 17:10 filipesilva

The test folder is empty. I tried to create new project inside it with ng new test-project. Just put ng -v there to demonstrate that ng is not running. Sorry for the confusion!

lekova avatar Oct 11 '16 03:10 lekova

Hm.... this error can appear if there's a node_modules folder with an older version anywhere in the folder hierarchy. Do you get the same error if you do this in, say, C:\test-folder\?

filipesilva avatar Oct 14 '16 16:10 filipesilva

@filipesilva, that is exactly the problem I had. There are projects with an older version in the folder tree where I was trying to install the latest angular-cli. So I did as you suggested, cd to C:\, uninstall, cache clean and install latest. Verified with ng new and ng serve. Thanks!!!

lekova avatar Oct 17 '16 01:10 lekova

Glad to hear it's sorted!

https://github.com/angular/angular-cli/pull/2178 should have sorted this scenario overall, but if there's a older ng install up in the tree that one will be used instead.

filipesilva avatar Oct 17 '16 22:10 filipesilva

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.