Skip to content

feat: report cached package managers during local install - #921

Closed
Aschenbath wants to merge 1 commit into
nodejs:mainfrom
Aschenbath:feat/local-install-output-423
Closed

Aschenbath wants to merge 1 commit into
nodejs:mainfrom
Aschenbath:feat/local-install-output-423

Conversation

@Aschenbath

Copy link
Copy Markdown

When corepack install reuses the project's package manager from the cache, it currently prints Adding ... to the cache... again and can omit the stored integrity hash. This change reports <name>@<version>+<hash> is already in the cache for cached installs.

  • Return isAlreadyInstalled from both paths of installVersion, and pass that status through the existing ensurePackageManager result. The status is per invocation and is not persisted in .corepack metadata.
  • Select the local install message after installation succeeds. Cache hits use the locator with the stored integrity hash; fresh installs retain the existing Adding ... message.
  • Cover repeated installs with and without an explicit hash, exact and ranged devEngines specifications, offline cache reuse, cache cleaning, unchanged project metadata, and repeated integrity failures. The integrity failure test checks stdout, matching Clipanion's existing command error handling, and rejects misleading installation or cache-hit messages.

Validation on Node.js 24.20.0:

  • Build bundle and regenerate shims: passed.
  • tsc --noEmit: passed.
  • ESLint across sources, tests, build script, and configuration with --max-warnings=0: passed.
  • Related Vitest suites (InstallLocal, corepackUtils, Use, Up, npmRegistryUtils): 35 tests passed, with retries disabled.
  • Full Vitest run in replay mode with environment proxy variables removed: 8 files passed, 176 tests passed, 1 expected failure; the live npm key test failed because direct external TLS is unavailable in this environment. Running tests/config.test.ts separately with the external proxy enabled passed (1 test). All 9 files have passed across these runs.

Closes #423

Signed-off-by: Aschenbath <Aschenbath@users.noreply.github.com>
@aduh95

aduh95 commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

This account has opened more than 10 PRs in the last 24 hours. This looks like bot activity, and will result in a ban if the behavior continues.

@aduh95 aduh95 closed this Oct 20, 2026
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.

corepack install output

2 participants