简体   繁体   中英

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.

ng config -g cli.packageManager yarn

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

要使用纱线进行 ng 更新,您还可以运行:

ng update --packageManager=yarn

ng update --all --packageManager=yarn

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

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"

    }
    

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM