DEV Community

Cover image for Installing Angular CLI Locally & Globally

Installing Angular CLI Locally & Globally

Wisdom John ikoi on September 15, 2022

Angular is a JavaScript Framework and it is one of the world most powerful web development platform. Starting an angular project will require an ...
Collapse
 
alexey_ryzhkov_c13bb6e84a profile image
Alexey Ryzhkov •

Hi, thanks for sharing the approach. Running some projects on the same windows machine I've faced to use different nodejs and angular cli versions simultaneously. I follow your way and have an issue with running ng when angular cli installed locally. I didn't install angular cli globally. I'm not sure do I need to have global angular cli if I need local versions? I will continue to try run it but it will be very kindly to hear your recommendations :) Thanks in advance.

Collapse
 
alexey_ryzhkov_c13bb6e84a profile image
Alexey Ryzhkov •

BTW. Hope it will help someone like me. For sure ng and ng.cmd are in the local node_modules. Maybe I can run it locally with direct path to them. But I just install globally lower version of angular/cli. Thus I can run "ng new ". And it works well.
Meanwhile I did steps after failure to run ng with local angular/cli:
State: No global anguar/cli. Local angular/cli is 18.1.1

  1. npm install -g @angular/cli@18.0 // especially to separate and test how it will work
  2. test ng and it works now but shows version 18.0
  3. install new app: ng new cli181
  4. move to cli181
  5. ng version // 18.1.1 as it is desired
  6. run ng serve --open --watch // it works as expected
Collapse
 
xenxei46 profile image
Wisdom John ikoi •

hey man, i haven't been active in so long but if this answer is still valid, uninstall the cli, try a global cli install first with the latest angular version then run a local installation.

Collapse
 
naucode profile image
Al - Naucode •

That was a nice read! Liked, bookmarked and followed, keep the good work!

Collapse
 
xenxei46 profile image
Wisdom John ikoi •

Thank you.

Collapse
 
xenxei46 profile image
Wisdom John ikoi •

thank you, i will

Collapse
 
xenxei46 profile image
Wisdom John ikoi •

thank you

Collapse
 
manojmj profile image
Manojkumar •

very informative content

Collapse
 
xenxei46 profile image
Wisdom John ikoi •

i'm happy to help

Collapse
 
kak_mca profile image
Ashok Kumar •

Thank you very much for this article, dude.

Collapse
 
xenxei46 profile image
Wisdom John ikoi •

you are welcome