Yasha  Gasparyan
Yasha Gasparyan

Reputation: 400

Angular CLI with yarn

How to change package manager for Angular Cli v6.0.3 to yarn? I tried:

ng set --global packageManager=yarn

But Angular says:

get/set have been deprecated in favor of the config command.

Upvotes: 35

Views: 28703

Answers (5)

Aseem Shrivastava
Aseem Shrivastava

Reputation: 31

you hav to update package manager from npm to yarn.

ng config --global packageManager=yarn

if you need back yarn to npm then

ng config --global packageManager=npm

Upvotes: 3

Christiyan Velkov
Christiyan Velkov

Reputation: 71

I. Global configuration

 ng config -g cli.packageManager yarn

II. For a particular project

 ng config cli.packageManager yarn

Or you can add it directly in angular.json like this :

   "cli": {
 
      "packageManager": "yarn"

    }
    

Upvotes: 7

kuldipem
kuldipem

Reputation: 1799

You can set global configuration using

ng config -g cli.packageManager yarn

If you want to set the package manager for a particular project then go to the root directory of the project and use the following command

ng config cli.packageManager yarn

Upvotes: 14

user3083736
user3083736

Reputation: 49

To ng update using yarn you can also run:

ng update --packageManager=yarn

ng update --all --packageManager=yarn

Upvotes: 4

Lia
Lia

Reputation: 11982

ng config -g cli.packageManager yarn

Upvotes: 86

Related Questions