Skip to content

Commit

Permalink
Update Corepack instructions in installation.md (#504)
Browse files Browse the repository at this point in the history
* Update Corepack instructions in `installation.md`

* Update docs/installation.md

Co-authored-by: Zoltan Kochan <z@kochan.io>

---------

Co-authored-by: Zoltan Kochan <z@kochan.io>
  • Loading branch information
aduh95 and zkochan authored Jan 27, 2024
1 parent 5d72f1e commit bd8a6be
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ If you have installed Node.js with `pnpm env` Corepack won't be installed on you
:::

```
corepack enable
corepack enable pnpm
```

If you installed Node.js using Homebrew, you'll need to install corepack separately:
Expand All @@ -76,18 +76,16 @@ If you installed Node.js using Homebrew, you'll need to install corepack separat
brew install corepack
```

This will automatically install pnpm on your system. However, it probably won't be the latest version of pnpm. To upgrade it, check what is the [latest pnpm version](https://github.com/pnpm/pnpm/releases/latest) and run:
This will automatically install pnpm on your system.

```
corepack prepare pnpm@<version> --activate
```

With Node.js v16.17 or newer, you may install the `latest` version of pnpm by just specifying the tag:
You can pin the version of pnpm used on your project using the following command:

```
corepack prepare pnpm@latest --activate
corepack use pnpm@latest
```

This will add a `"packageManager"` field in your local `package.json` which will instruct Corepack to always use a specific version on that project. This can be useful if you want reproducability, as all developers who are using Corepack will use the same version as you. When a new version of pnpm is released, you can re-run the above command.

## Using npm

We provide two packages of pnpm CLI, `pnpm` and `@pnpm/exe`.
Expand Down

0 comments on commit bd8a6be

Please sign in to comment.