nodejs plugin: don't break the shell when corepack is unavailable (nodejs-slim)#2843
Open
mikeland73 wants to merge 1 commit into
Open
nodejs plugin: don't break the shell when corepack is unavailable (nodejs-slim)#2843mikeland73 wants to merge 1 commit into
mikeland73 wants to merge 1 commit into
Conversation
The nodejs-slim package no longer ships corepack as a default output, so the plugin's init_hook failed with 'corepack: command not found' whenever DEVBOX_COREPACK_ENABLED was set (which the node templates set by default). Wrap the corepack invocation in a 'command -v corepack' check so the shell no longer breaks when corepack is unavailable, and print a helpful warning pointing users to the nodejs package or adding corepack explicitly. Fixes #2791
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
Fixes #2791.
nodejs-slimrecently stopped shippingcorepackas a default output. The built-innodejsplugin'sinit_hookunconditionally runscorepack enablewheneverDEVBOX_COREPACK_ENABLEDis set — and thenode-yarn/node-pnpmtemplates set that variable by default. As a result, switching a project tonodejs-slimbroke the shell:This guards the corepack invocation with a
command -v corepackcheck:PATH).nodejs-slimno longer ships corepack and suggesting thenodejspackage or adding corepack explicitly.DEVBOX_COREPACK_ENABLEDis unset → nothing runs, as before.The plugin
versionis bumped0.0.2→0.0.3to follow convention.How was it tested?
Validated the JSON and exercised the new shell snippet in all three states (corepack present + enabled, corepack absent + enabled, disabled) to confirm it enables corepack when present, warns instead of erroring when absent, and stays silent when not enabled.
cc @apgrucza (issue reporter)
Generated by Claude Code