Skip to content

Set npm_config_user_agent when running pnpx and pnpm create #3985

@cyco130

Description

@cyco130

Describe the user story

In create-* packages one often wants to install npm dependencies at the end of project initialization. But this requires determining the preferred package manager of the user. Most packages add a CLI option or prompt for this purpose. But the user has already expressed their choice buy running npm init, yarn create, or pnpm create (or init, or pnpx create-* etc.). We could determine the package manager choice if there was a way to determine the package manager that launched the create-* script.

Describe the solution you'd like

npm and yarn set the npm_config_user_agent environment variable under these circumstances but pnpm doesn't. The problem would be solved if it did. The inconsistency with the other package managers even suggests that it may simply be a bug and not a missing feature.

Describe the drawbacks of your solution

None I can think of.

Describe alternatives you've considered

There are no alternatives I can think of but asking the user explicitly for their package manager preference.

Metadata

Metadata

Assignees

Type

No type

Projects

Status

in progress

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions