-
Notifications
You must be signed in to change notification settings - Fork 173
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3958d26
commit ed0350e
Showing
14 changed files
with
59 additions
and
163 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,8 +2,8 @@ | |
|
||
Corepack is a zero-runtime-dependency Node.js script that acts as a bridge | ||
between Node.js projects and the package managers they are intended to be used | ||
with during development. In practical terms, **Corepack lets you use Yarn, npm, | ||
and pnpm without having to install them**. | ||
with during development. In practical terms, **Corepack lets you use Yarn and pnpm | ||
without having to install them**. | ||
|
||
## How to Install | ||
|
||
|
@@ -50,8 +50,8 @@ See [`CONTRIBUTING.md`](./CONTRIBUTING.md). | |
### When Building Packages | ||
|
||
Just use your package managers as you usually would. Run `yarn install` in Yarn | ||
projects, `pnpm install` in pnpm projects, and `npm` in npm projects. Corepack | ||
will catch these calls, and depending on the situation: | ||
projects and `pnpm install` in pnpm projects. Corepack will catch these calls, | ||
and depending on the situation: | ||
|
||
- **If the local project is configured for the package manager you're using**, | ||
Corepack will silently download and cache the latest compatible version. | ||
|
@@ -79,7 +79,7 @@ Here, `yarn` is the name of the package manager, specified at version `3.2.3`, | |
along with the SHA-224 hash of this version for validation. | ||
`[email protected]` is required. The hash is optional but strongly | ||
recommended as a security practice. Permitted values for the package manager are | ||
`yarn`, `npm`, and `pnpm`. | ||
`yarn` and `pnpm`. | ||
|
||
You can also provide a URL to a `.js` file (which will be interpreted as a | ||
CommonJS module) or a `.tgz` file (which will be interpreted as a package, and | ||
|
@@ -148,9 +148,7 @@ Clears the local `COREPACK_HOME` cache directory. | |
|
||
This command will detect where Corepack is installed and will create shims next | ||
to it for each of the specified package managers (or all of them if the command | ||
is called without parameters). Note that the npm shims will not be installed | ||
unless explicitly requested, as npm is currently distributed with Node.js | ||
through other means. | ||
is called without parameters). | ||
|
||
If the file system where the `corepack` binary is located is read-only, this | ||
command will fail. A workaround is to add the binaries as alias in your | ||
|
@@ -161,8 +159,6 @@ alias yarn="corepack yarn" | |
alias yarnpkg="corepack yarnpkg" | ||
alias pnpm="corepack pnpm" | ||
alias pnpx="corepack pnpx" | ||
alias npm="corepack npm" | ||
alias npx="corepack npx" | ||
``` | ||
|
||
On Windows PowerShell, you can add functions using the `$PROFILE` automatic | ||
|
@@ -173,8 +169,6 @@ echo "function yarn { corepack yarn `$args }" >> $PROFILE | |
echo "function yarnpkg { corepack yarnpkg `$args }" >> $PROFILE | ||
echo "function pnpm { corepack pnpm `$args }" >> $PROFILE | ||
echo "function pnpx { corepack pnpx `$args }" >> $PROFILE | ||
echo "function npm { corepack npm `$args }" >> $PROFILE | ||
echo "function npx { corepack npx `$args }" >> $PROFILE | ||
``` | ||
|
||
### `corepack disable [... name]` | ||
|
@@ -250,7 +244,7 @@ same major line. Should you need to upgrade to a new major, use an explicit | |
ask for user input before starting the download. | ||
|
||
- `COREPACK_ENABLE_UNSAFE_CUSTOM_URLS` can be set to `1` to allow use of | ||
custom URLs to load a package manager known by Corepack (`yarn`, `npm`, and | ||
custom URLs to load a package manager known by Corepack (`yarn` and | ||
`pnpm`). | ||
|
||
- `COREPACK_ENABLE_NETWORK` can be set to `0` to prevent Corepack from accessing | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -350,13 +350,6 @@ export async function runVersion(locator: Locator, installSpec: InstallSpec & {s | |
if (!binPath) | ||
throw new Error(`Assertion failed: Unable to locate path for bin '${binName}'`); | ||
|
||
// Node.js segfaults when using npm@>=9.7.0 and v8-compile-cache | ||
// $ docker run -it node:20.3.0-slim corepack [email protected] --version | ||
// [SIGSEGV] | ||
if (locator.name !== `npm` || semver.lt(locator.reference, `9.7.0`)) | ||
// @ts-expect-error - No types | ||
await import(`v8-compile-cache`); | ||
|
||
// We load the binary into the current process, | ||
// while making it think it was spawned. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.