mirror of
https://github.com/jbranchaud/til
synced 2026-01-03 07:08:01 +00:00
Add Globally Install A Package With Yarn as a javascript til
This commit is contained in:
18
javascript/globally-install-a-package-with-yarn.md
Normal file
18
javascript/globally-install-a-package-with-yarn.md
Normal file
@@ -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/)
|
||||
Reference in New Issue
Block a user