nodejs / nodejs/corepack

Feature request: corepack run

Open
#57 26 comments 10 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

Add corepack run with the same behavior as [npm|yarn] run to reduce the necessity of a package manager to run user-defined scripts in the package.json. e.g. with this start script

"scripts": {
  "start": "node index.js"
}

we don't need a package manager to run:

$ corepack run start

Also, we should add the Corepack's wrappers (npm, pnpm and yarn) to the PATH automatically. Achieving the same effect like corepack enable but only on the context of the command execution to support scripts like the following:

"test": "npm run env:test && jest",

Without adding the package managers as global commands.

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

Start at the corepack run command entry point and compare its intended behavior with [npm|yarn] run, using the package.json scripts example as the baseline. Then examine how Corepack's npm, pnpm, and yarn wrappers are exposed during command execution. Done means user-defined scripts run without a global package manager and nested wrapper commands resolve only for that execution.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, typescript
Domain
cli
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.