Skip to content
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

Closed
wants to merge 5 commits into from
Closed

Conversation

arcanis
Copy link
Contributor

@arcanis arcanis commented Feb 27, 2024

The Corepack team always made it clear that enabling npm support in Corepack was contingent on the npm team being supportive of this effort.

The npm team mentioned in nodejs/node#50963 (comment) that they are welcoming of other package managers being shipped with Node througn Corepack, but don't wish npm to be distributed this way. That's entirely their right, we made sure that this project wouldn't have any impact on npm unless they wished it.

Still, since some people are getting fired up about what could have been but won't be, perhaps we should go one step further. This PR removes any mention of npm support from the README (adding it as a non-goal instead), and adds an additional warning to the prompt when npm would otherwise be downloaded.

@arcanis
Copy link
Contributor Author

arcanis commented Feb 27, 2024

Alternatively, perhaps we could just extend the README to remove the npm references, explain there that supporting npm is a non-goal and provided on a best effort basis, and perhaps add an additional message on the prompt line to mention it there as well.

Edit: That's what I did, it feels a less risky change.

@arcanis arcanis changed the title Removes any integrated support of npm from Corepack Adds a warning when using npm through Corepack Feb 27, 2024
@arcanis arcanis marked this pull request as ready for review February 27, 2024 08:25
Copy link
Contributor

@aduh95 aduh95 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One of Corepack's goal is to provide a levelled playing field, having npm being a special case seems to go against this goal. Also, if users want to use npm through Corepack, it should be their right to do so. npm can a warning on their side if they feel like it, it feels out of place for Corepack to add such warning.


### 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.
Copy link
Contributor

Choose a reason for hiding this comment

The 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.

Copy link
Member

@styfle styfle Feb 27, 2024

Choose a reason for hiding this comment

The 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.

@@ -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**.
Copy link
Member

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?

Copy link
Contributor Author

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.


### 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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to repeat the header of this section

Suggested change
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.
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.

@GeoffreyBooth
Copy link
Member

One of Corepack’s goal is to provide a levelled playing field

Where is this defined?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants