Skip to content

Commit d5ef940

Browse files
aduh95merceyz
andauthored
chore(docs): document how to use aliases instead of jumper binaries (#244)
Co-authored-by: Kristoffer K. <[email protected]>
1 parent df89e38 commit d5ef940

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

README.md

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,12 +131,37 @@ on a project where the `packageManager` field references `pnpm`).
131131
| --------------------- | --------------------------------------- |
132132
| `--install-directory` | Add the shims to the specified location |
133133

134-
This command will detect where Node.js is installed and will create shims next
134+
This command will detect where Corepack is installed and will create shims next
135135
to it for each of the specified package managers (or all of them if the command
136136
is called without parameters). Note that the npm shims will not be installed
137137
unless explicitly requested, as npm is currently distributed with Node.js
138138
through other means.
139139

140+
If the file system where the `corepack` binary is located is read-only, this
141+
command will fail. A workaround is to add the binaries as alias in your
142+
shell configuration file (e.g. in `~/.bash_aliases`):
143+
144+
```sh
145+
alias yarn="corepack yarn"
146+
alias yarnpkg="corepack yarnpkg"
147+
alias pnpm="corepack pnpm"
148+
alias pnpx="corepack pnpx"
149+
alias npm="corepack npm"
150+
alias npx="corepack npx"
151+
```
152+
153+
On Windows PowerShell, you can add functions using the `$PROFILE` automatic
154+
variable:
155+
156+
```powershell
157+
echo "function yarn { corepack yarn `$args }" >> $PROFILE
158+
echo "function yarnpkg { corepack yarnpkg `$args }" >> $PROFILE
159+
echo "function pnpm { corepack pnpm `$args }" >> $PROFILE
160+
echo "function pnpx { corepack pnpx `$args }" >> $PROFILE
161+
echo "function npm { corepack npm `$args }" >> $PROFILE
162+
echo "function npx { corepack npx `$args }" >> $PROFILE
163+
```
164+
140165
### `corepack disable [... name]`
141166

142167
| Option | Description |

0 commit comments

Comments
 (0)