DEV Community

Manthan Ankolekar
Manthan Ankolekar

Posted on

Add package manager to Angular app

Adding packageManager in angular.sjon

{
  "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
  "version": 1,
  "newProjectRoot": "projects",
    "projects" {
    ...
    },
  "cli": {
    "packageManager": "npm" // either select yarn, npm, pnpm or cnpm
    }
}
Enter fullscreen mode Exit fullscreen mode

Top comments (3)

Collapse
 
juanpinzon profile image
Juan Carlos Pinzón

What is the usefulness of this?

Collapse
 
manthanank profile image
Manthan Ankolekar

Ex: If working with yarn packages then or other packages this would be very useful. Just add like this.
"cli": {
"packageManager": "yarn"
}

Next install some package. Example: Angular Material.
Now it install yarn package of it. Not default ie, npm

Collapse
 
juanpinzon profile image
Juan Carlos Pinzón

Thank you!