Repository navigation
fix(nodejs plugin): create corepack-bin before enabling Corepack - #3042
Merged
Merged
Conversation
`corepack enable --install-directory` fails with ENOENT when the install directory doesn't exist. The plugin's create_files makes that directory, but devbox only runs create_files during a full recompute, so if the directory goes missing while .devbox/state.json is still up to date (for example a .devbox copied into a new git worktree without its empty directories), every devbox run and shell fails in the init hook. setup-corepack.mjs now creates the directory itself before running `corepack enable`. Bump the plugin version to 0.0.6. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
Collaborator
Author
|
@claude ptal |
|
Claude finished @mikeland73's task in 14s —— View job Review of PR #3042I read the diff and found nothing that should block merging.
Optional nits:
I did not run the tests myself. I relied on the results in the PR description. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
With
DEVBOX_COREPACK_ENABLEDset, everydevbox run/devbox shellcan fail in the nodejs plugin's init hook with:corepack-binis an empty directory the plugin creates throughcreate_files. Devbox only runscreate_filesduring a full recompute. If the directory goes missing while.devbox/state.jsonis still up to date, devbox doesn't recreate it, andcorepack enable --install-directoryfails because the directory doesn't exist. One way this happens is a.devboxcopied into a new git worktree: the copy keepssetup-corepack.mjsbut drops empty directories.Changes
plugins/nodejs/setup-corepack.mjs: create the install directory (mkdirSync(..., { recursive: true })) before runningcorepack enable.plugins/nodejs.json: bump the plugin version to 0.0.6.testscripts/plugin/nodejs_corepack_autodetect.test.txt: new case that deletescorepack-binwhile state is up to date, then checks thatdevbox runsucceeds, prints noENOENT, and installs the pnpm shim.Testing
go test ./testscripts -run 'TestScripts/nodejs_corepack_autodetect'passes. With the script change reverted, the new case fails.nodejs@24: after deletingcorepack-bin,devbox runreproduced the error before the fix. After the fix, it recreates the directory, andwhich pnpmresolves intocorepack-bin.🤖 Generated with Claude Code