Skip to content

fix: improve pnpm installation script#463

Open
Tguntenaar wants to merge 1 commit into
frappe:developfrom
Tguntenaar:develop
Open

fix: improve pnpm installation script#463
Tguntenaar wants to merge 1 commit into
frappe:developfrom
Tguntenaar:develop

Conversation

@Tguntenaar

Copy link
Copy Markdown

Problem

When building a custom image via frappe_docker with the gameplan app included in
apps.json, bench init fails during asset building with a confusing
exit code 127 from Yarn.

The root cause: install-pnpm.sh unconditionally exits 0 even when
npm install -g pnpm@latest-10 silently fails (e.g. in minimal Docker
images where global installs can behave unexpectedly). The build then
continues into pnpm install && pnpm build with no pnpm binary
available, which blows up deep in the Yarn/bench build chain.

The log looks like this:

pnpm could not be found, installing...
pnpm version:
...
status: 127
error Command failed with exit code 1.

Fix

  • Add set -euo pipefail so failures aren't silently swallowed.
  • After the install attempt, verify pnpm is actually on PATH before
    continuing. If it's not, exit 1 with a clear message instead of
    letting the build proceed and fail later with a misleading error.
  • Remove the unconditional exit 0 at the end.

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.

1 participant