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

Support pnpm dlx hardhat --init #6111

Open
Tracked by #6115
kanej opened this issue Jan 6, 2025 · 0 comments
Open
Tracked by #6115

Support pnpm dlx hardhat --init #6111

kanej opened this issue Jan 6, 2025 · 0 comments
Labels
status:ready This issue is ready to be worked on v-next A Hardhat v3 development task

Comments

@kanej
Copy link
Member

kanej commented Jan 6, 2025

This one was raised by Franco:

The detection of the package manager is wrong when doing pnpm dlx @ignored/hardhat-vnext@next --init. It installs things with npm. My guess is that the logic is "use pnpm if a pnpm-lock.yaml file exists", but this doesn't work when using pnpm dlx.

I think we should first try using process.env.npm_config_user_agent. It seems to be supported by npm, pnpm and yarn. If that's undefined or we can't use it for any reason, then we can fallback to the current logic. These are the values returned in my machine for each package manager:

npm/10.9.0 node/v22.12.0 linux x64 workspaces/false
pnpm/9.15.0 npm/? node/v22.12.0 linux x64
yarn/4.5.3 npm/? node/v22.12.0 linux x64
@kanej kanej mentioned this issue Jan 6, 2025
23 tasks
@kanej kanej added the v-next A Hardhat v3 development task label Jan 6, 2025
@github-actions github-actions bot added the status:ready This issue is ready to be worked on label Jan 6, 2025
@fvictorio fvictorio added this to Hardhat Jan 6, 2025
@github-project-automation github-project-automation bot moved this to Backlog in Hardhat Jan 6, 2025
@kanej kanej added this to the vnext milestone Jan 6, 2025
@kanej kanej moved this from Backlog to To-do in Hardhat Jan 6, 2025
@kanej kanej mentioned this issue Jan 7, 2025
4 tasks
@kanej kanej modified the milestones: vnext, Feature Rollout Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:ready This issue is ready to be worked on v-next A Hardhat v3 development task
Projects
Status: To-do
Development

No branches or pull requests

1 participant