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 ?

5
  • you cannot use angular-cli commands such as ng generate without the global version. Commented Feb 1, 2018 at 16:12
  • 3
    stackoverflow.com/questions/44525746/… Commented Feb 1, 2018 at 16:12
  • yeah exactly. You can't generate a project without the global version. Commented Feb 1, 2018 at 16:13
  • 2
    @DavidAnthonyAcosta what about local one, when is it used ? Commented Feb 1, 2018 at 16:15
  • WHy the thumbs down.. this is a valid question Commented Mar 19, 2021 at 2:20

2 Answers 2

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.

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

Comments

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

( local installation ) e.g.

[email protected]:~/Desktop/myFirstApp$ ng serve -o
  1. If you execute it through npm cmd like

    [email protected]:~/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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.