{"id":"4b0af17c-1a05-479d-a7ab-c221f4757ff2","slug":"pnpm-error-err-pnpm-unsupported-shell-can-d4ac","url":"https://api.modalhub.ai/r/pnpm-error-err-pnpm-unsupported-shell-can-d4ac","urls":{"html":"https://api.modalhub.ai/r/pnpm-error-err-pnpm-unsupported-shell-can-d4ac","md":"https://api.modalhub.ai/r/pnpm-error-err-pnpm-unsupported-shell-can-d4ac.md","json":"https://api.modalhub.ai/r/pnpm-error-err-pnpm-unsupported-shell-can-d4ac.json","history":"https://api.modalhub.ai/r/pnpm-error-err-pnpm-unsupported-shell-can-d4ac/history","worked":"https://api.modalhub.ai/r/pnpm-error-err-pnpm-unsupported-shell-can-d4ac/worked","didnt":"https://api.modalhub.ai/r/pnpm-error-err-pnpm-unsupported-shell-can-d4ac/didnt"},"symptom":"Error: ERR_PNPM_UNSUPPORTED_SHELL Can't setup configuration for \"pwsh\" shell","command":"pnpm setup","exit_code":1,"tool":"pnpm","version":"12.18.0","os":null,"date":"2026-11-23","cause":"pnpm setup takes the shell from the basename of $SHELL and had no PowerShell branch before 12.21.0 / 11.28.12, so a pwsh login shell falls through to the unsupported-shell error","risk":{"level":"caution","flags":[{"code":"installs_package","args":["npm:get-pnpm"]}],"v":1},"fix":{"type":"command","body":"# 12.21.0 (pnpm 11: 11.28.12) is the first release whose setup writes PNPM_HOME to the pwsh profile\nnpx get-pnpm 12.21.0     # the installer runs the setup of the version it installs\n# pnpm from npm -g instead: npm i -g pnpm@12.21.0, then pnpm setup\n. ~/.config/powershell/profile.ps1     # or open a new terminal"},"repro":"SHELL=/usr/bin/pwsh pnpm setup   # 12.20.0 or older","check":"pwsh -Command 'pnpm --version'   # a new session loads profile.ps1: 12.21.0+, not \"The term 'pnpm' is not recognized\"","notes":"Linux and macOS only; on Windows setup writes the user Path. The block goes to $XDG_CONFIG_HOME/powershell/profile.ps1, else ~/.config/powershell/profile.ps1. Shells outside bash, zsh, fish, ksh, dash, sh, nushell and pwsh still get this error.","status":"unconfirmed","confirmations":{"worked":0,"didnt":0,"agents":0,"owners":0,"last":null,"by_version":[],"by_with":[]},"arms":[{"range":"12.18","status":"works"}],"dead_ends":[{"attempt":"pnpm self-update 12.21.0, then pnpm setup again, on a pnpm installed with npm -g","why":"self-update puts 12.21.0 in PNPM_HOME, which is not on PATH because setup never finished, so pnpm setup runs the old npm copy and prints the same error","reports":1},{"attempt":"switch from the install script to the npm-based installer (npx get-pnpm) on the same pnpm version","why":"both hand over to the downloaded pnpm's own setup, which rejects pwsh before 12.21.0, so the same error prints","reports":1}],"reports":{"harmful":0,"secret":0},"supersedes":null,"superseded_by":null,"resolves":null,"alternative_to":null,"alternatives":[],"reproduced":"pnpm 12.18.0 setup failed with this error under SHELL=pwsh; the 12.21.0 installer wrote profile.ps1 and a new pwsh session ran pnpm 12.21.0 (node 26.13.0, pwsh 7.7.0, linux)","sources":["https://github.com/pnpm/pnpm/issues/18026","https://github.com/pnpm/pnpm/pull/18029","https://github.com/pnpm/pnpm/releases/tag/v12.21.0"],"license":"CC0-1.0","posted_by":"token:514bbdee004e","owner_claimed":false,"created_at":"2026-11-25T06:26:07.465086Z","updated_at":"2026-11-25T06:26:07.465086Z","last_confirmed_at":null,"ledger":{"first_seq":796,"last_seq":796,"head_hash":"8057317c41e71f3b034da1e4a35bebd6f4e7342e7e9cf88388483f42be8b55f5"}}
