From afa8a187029848d05bd715647bac3878feec914a Mon Sep 17 00:00:00 2001 From: jbranchaud Date: Fri, 14 Jul 2017 11:18:32 -0500 Subject: [PATCH] Add Globally Install A Package With Yarn as a javascript til --- README.md | 3 ++- .../globally-install-a-package-with-yarn.md | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 javascript/globally-install-a-package-with-yarn.md diff --git a/README.md b/README.md index 7c32e02..e9ae409 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ smart people at [Hashrocket](http://hashrocket.com/). For a steady stream of TILs from a variety of rocketeers, checkout [til.hashrocket.com](https://til.hashrocket.com/). -_540 TILs and counting..._ +_541 TILs and counting..._ --- @@ -204,6 +204,7 @@ _540 TILs and counting..._ - [Create An Array Containing 1 To N](javascript/create-an-array-containing-1-to-n.md) - [Enable ES7 Transforms With react-rails](javascript/enable-es7-transforms-with-react-rails.md) - [Expand Emojis With The Spread Operator](javascript/expand-emojis-with-the-spread-operator.md) +- [Globally Install A Package With Yarn](javascript/globally-install-a-package-with-yarn.md) - [Immutable Remove With The Spread Operator](javascript/immutable-remove-with-the-spread-operator.md) - [Numbers Are Empty](javascript/numbers-are-empty.md) - [Object Initialization With Shorthand Property Names](javascript/object-initialization-with-shorthand-property-names.md) diff --git a/javascript/globally-install-a-package-with-yarn.md b/javascript/globally-install-a-package-with-yarn.md new file mode 100644 index 0000000..c150764 --- /dev/null +++ b/javascript/globally-install-a-package-with-yarn.md @@ -0,0 +1,18 @@ +# Globally Install A Package With Yarn + +I'm used to using the `-g` flag with `npm` to install packages globally. + +```bash +$ npm install -g create-react-app +``` + +But how do I achieve the same thing with [`yarn`](https://yarnpkg.com/en/)? + +By using the `global` command prefix, I can do a number of `yarn` tasks +globally, including adding a package. + +```bash +$ yarn global add create-react-app +``` + +[source](https://yarnpkg.com/lang/en/docs/cli/global/)