Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular CLI with yarn

Tags:

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.

like image 424
Yasha Gasparyan Avatar asked Jun 23 '18 08:06

Yasha Gasparyan


People also ask

Can I use yarn with Angular?

Angular CLI is another tool that helps you manage your angular project. It helps you create, build, generate components, services and others for your project. By default, it uses NPM for package management but it also supports Yarn.

Which is better yarn or NPM?

While NPM installs packages sequentially, Yarn performs parallel installation resulting in better speed and performance. NPM has tried to fix vulnerabilities, but still, Yarn is considered more secure than NPM. Yarn also comes with advanced features like Plug'n'Play and Zero-Install.

Can you use NPM install with yarn?

Yarn can consume the same package. json format as npm, and can install any package from the npm registry. This will lay out your node_modules folder using Yarn's resolution algorithm that is compatible with the node.

How do you execute a command in yarn?

yarn run [script] [<args>]json . You can pass additional arguments to your script by passing them after the script name. Running this command will execute jest -o --watch . [script] can also be any locally installed executable that is inside node_modules/.


2 Answers

ng config -g cli.packageManager yarn 
like image 113
Fateme Fazli Avatar answered Sep 20 '22 15:09

Fateme Fazli


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 
like image 28
kuldipem Avatar answered Sep 21 '22 15:09

kuldipem