Skip to content

fix: give pnpm installer a default SHELL to avoid ERR_PNPM_UNKNOWN_SHELL#55

Merged
bushidocodes merged 1 commit into
masterfrom
fix/pnpm-default-shell
Jun 16, 2026
Merged

fix: give pnpm installer a default SHELL to avoid ERR_PNPM_UNKNOWN_SHELL#55
bushidocodes merged 1 commit into
masterfrom
fix/pnpm-default-shell

Conversation

@bushidocodes

Copy link
Copy Markdown
Owner

Problem

The pnpm install recipe pipes the installer to sh -, and the installer infers which rc file to update from $SHELL. When $SHELL is unset (non-interactive shells, some CI/cron/container contexts) it aborts:

[ERR_PNPM_UNKNOWN_SHELL] Could not infer shell type.
Set the SHELL environment variable to your active shell.
Install Error!  ->  make: *** [Makefile: .../bin/pnpm] Error 1

Fix

Default SHELL to /bin/bash for the installer when it isn't already set (a normal interactive run keeps using the real $SHELL):

curl -fsSL https://get.pnpm.io/install.sh | SHELL="$${SHELL:-/bin/bash}" sh -

Verification

In a fresh ubuntu:24.04 container with SHELL explicitly unset:

# old: curl ... | sh -
[ERR_PNPM_UNKNOWN_SHELL] Could not infer shell type.  Install Error!

# new: curl ... | SHELL="${SHELL:-/bin/bash}" sh -
Done in 3.8s using pnpm v11.7.0   (binary installed)

Fixes #49

🤖 Generated with Claude Code

The pnpm install recipe (curl | sh -) infers which rc file to update
from $SHELL and aborts when it is unset (non-interactive shells, some
CI/cron/container contexts):

    [ERR_PNPM_UNKNOWN_SHELL] Could not infer shell type.
    Install Error!  ->  make Error 1

Default SHELL to /bin/bash for the installer when it isn't already set.

Verified in a fresh ubuntu:24.04 container with SHELL unset: the old
command errors out, the new one installs pnpm 11.7.0 cleanly.

Fixes #49

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@bushidocodes bushidocodes merged commit ddada8a into master Jun 16, 2026
2 checks passed
@bushidocodes bushidocodes deleted the fix/pnpm-default-shell branch June 16, 2026 02:27
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.

pnpm install fails with ERR_PNPM_UNKNOWN_SHELL when $SHELL is unset

1 participant