-
Notifications
You must be signed in to change notification settings - Fork 170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds a warning when using npm through Corepack #407
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -3,7 +3,7 @@ | |||||
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**. | ||||||
and other supported package managers 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, `pnpm install` in pnpm projects, etc. 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 | ||||||
|
@@ -161,8 +161,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 +171,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]` | ||||||
|
@@ -299,6 +295,12 @@ There are a wide variety of networking issues that can occur while running `core | |||||
`curl [URL]` (ipv4) and `curl -6 [URL]` (ipv6) from your shell. | ||||||
- Check your proxy settings (see [Environment Variables](#environment-variables)). | ||||||
|
||||||
## Non-goals | ||||||
|
||||||
### Official npm integration | ||||||
|
||||||
Official npm integration is a non-goal at this time. The npm team made it clear they don't wish npm to be distributed through Corepack (some of their concerns are listed [here](https://github.com/nodejs/node/issues/50963#issuecomment-1862957925)). Corepack focuses on the use case from officially supported package managers. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's no longer true since we added support for HTTP references, the goal is very much to help user run any package manager. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed. This warning might need to apply to pnpm and bun depending on how you define "officially supported" by their team. Its best to leave it out. The log "Corepack is about to download" should be enough to differentiate Corepack usage vs calling directly. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No need to repeat the header of this section
Suggested change
|
||||||
|
||||||
## Contributing | ||||||
|
||||||
See [`CONTRIBUTING.md`](./CONTRIBUTING.md). | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did we remove pnpm from this list?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mistake; I meant to remove npm and leave pnpm.