nodejs / nodejs/corepack

Feature request: corepack exec

Open
#148 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
3.8k
Forks
279
Avg merge
1h 47m
Merged PRs (30d)
2

Description

Hi,

This feature request is not exactly the same than the one mentioned in #57. As introduced in the docs here, command corepack <binary name>[@<version>] [... args] allows to execute a package manager of our choice with custom arguments. This command checks whether the local project is configured for the given package manager.

I personnally would be interested with a command such as corepack exec [... args] (exec may not be the most relevant term however), that would take the exact release set in the packageManager property. I guess it is possible because in the command above, I assume corepack parses property packageManager in the package.json file to verify consistency with <binary name>.
Thus, I could run a command of the package manager whatever it is, and without repeating the binary name. This may be useful in writing plugins/extensions for build tools such as Maven, Gradle, acting as a bridge to launch npm/pnpm/yarn commands, without having to parse the package.json file and discover the package manager.

Thanks in advance for your comments.
BR

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read the Corepack command documentation linked in the issue and inspect how the existing corepack <binary name>[@<version>] [... args] entry point handles the packageManager property in package.json. Define the command name and selection behavior, then verify that it forwards arbitrary arguments to the configured package manager without requiring callers to parse package.json.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, typescript
Domain
cli, developer-experience
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.