Reputation: 2729
I am new to angular application, I had installed angular/cli globally via npm install -g @angular/cli, now I want to create another app. Do I need to install angular/cli once again. If not how do I ref the global one?
Upvotes: 2
Views: 918
Reputation: 24424
you just need to install angular cli globaly npm install -g @angular/cli
in two cases
install angular cli for the first time on this machine.
update angular cli version.
create a new angular project
ng new angular-starter-app
run this command
npm install -g @angular/cli
will install angular cli latest version in case you have old version but this will not have any effect of any old version generated project because an angular project has dev dependency to the cli with the same version at the time it create ,you will get a warning and the local version will be used.
check other cli option 👉 here
Upvotes: 0
Reputation: 240
It is not necessary unless you change the node version, for more security check if it is still installed with the following command
ng -v
or
ng version
if it is installed, only the new application must be created with the usual command
ng new my-app
Upvotes: 1
Reputation: 26
You shouldn't need to. You should be able to use the 'ng' commands once it's installed globally. I used their setup documentation for my first angular app. Here is a link https://angular.io/guide/setup-local
Upvotes: 1