5

I have noticed that I have a local and global angular/cli package installed.

When angular/cli local package is used compared to global one ?

Amit Kumar Lal
  • 5,537
  • 3
  • 19
  • 37
user2080105
  • 1,642
  • 4
  • 18
  • 27

2 Answers2

1

local package will used from angular cli self. If you using ng on a terminal the global installation is used. To building by typescript files, i using the local cli installation.

moohkooh
  • 917
  • 1
  • 10
  • 25
1
  1. If you use ng cmd in terminal, it will look into global packages instead of node_modules folder

( local installation ) e.g.

wayne@bruce...PC:~/Desktop/myFirstApp$ ng serve -o
  1. If you execute it through npm cmd like

    wayne@bruce...PC:~/Desktop/myFirstApp$ npm start

and in package.json something like this

"scripts": {
  "ng": "ng",
  "start": "ng serve -o",
  "build": "ng build --prod",
  "test": "ng test",
  "lint": "ng lint",
  "e2e": "ng e2e",
  "deploy": "ng deploy",
  "build:stats": "ng build --stats-json",
  "analyze": "webpack-bundle-analyzer dist/app/stats-es2015.json"}

Then it will look into node_modules folder i.e. local installation

In both cases same cmd will be executed.

Vikram Sapate
  • 1,087
  • 1
  • 11
  • 16