Skip to content

pnpm 11 fails when using mise #577

@JuanM04

Description

@JuanM04

When using pnpm v11, I get these logs

> Installing railpack, please wait…
____       _ _                  _
|  _ \ __ _(_) |_ __   __ _  ___| | __
| |_) / _` | | | '_ \ / _` |/ __| |/ /
|  _ < (_| | | | |_) | (_| | (__|   <
|_| \_\__,_|_|_| .__/ \__,_|\___|_|\_\
|_|
Railpack is now installed!
Run 'railpack --help' to get started
builder-containerd
Preparing Railpack build plan...
╭─────────────────╮
│ Railpack 0.26.0 │
╰─────────────────╯
↳ Detected Node
↳ Using pnpm package manager
Packages
──────────
pnpm  │  11.5.1   │  package.json > engines > pnpm (11.5.x)
node  │  24.16.0  │  package.json > engines > node (24.16.0)
Steps
──────────
▸ install
$ pnpm add -g node-gyp
$ pnpm install --frozen-lockfile --prefer-offline
▸ build
$ pnpm run build
Deploy
──────────
$ pnpm run start
✅ Railpack prepare completed.
Building with Railpack frontend...
#0 building with "builder-containerd" instance using docker-container driver
...
#11 install mise packages: node, pnpm
#11 2.688 mise node@24.16.0    [1/3] install
#11 2.694 mise node@24.16.0    [1/3] download node-v24.16.0-linux-x64.tar.gz
#11 2.710 mise pnpm@11.5.1     [1/3] install
#11 3.781 mise pnpm@11.5.1     [1/3] download pnpm-linux-x64.tar.gz
#11 4.667 mise node@24.16.0    [2/3] generate checksum node-v24.16.0-linux-x64.tar.gz
#11 4.712 mise node@24.16.0    [3/3] extract node-v24.16.0-linux-x64.tar.gz
#11 8.104 mise node@24.16.0    [3/3] node -v
#11 8.347 mise node@24.16.0    [3/3] v24.16.0
#11 8.359 mise node@24.16.0    [3/3] npm -v
#11 8.993 mise node@24.16.0    [3/3] 11.13.0
#11 9.023 mise node@24.16.0  ✓ installed
#11 11.33 mise pnpm@11.5.1     [2/3] verify GitHub artifact attestations
#11 14.87 mise pnpm@11.5.1     [2/3] ✓ GitHub artifact attestations verified
#11 14.87 mise pnpm@11.5.1     [2/3] checksum pnpm-linux-x64.tar.gz
#11 15.23 mise pnpm@11.5.1     [3/3] extract pnpm-linux-x64.tar.gz
#11 19.34 mise pnpm@11.5.1   ✓ installed
#11 DONE 25.3s
#12 copy / /app
#12 DONE 4.6s
#13 mkdir -p /app/node_modules/.cache
#13 DONE 3.6s
#14 pnpm add -g node-gyp
#14 11.53 [ERROR] The configured global bin directory "/opt/pnpm/bin" is not in PATH
#14 11.53 Run "pnpm setup" to update your shell configuration.
#14 ...
#15 copy /mise/shims
#15 ...
#14 pnpm add -g node-gyp
#14 ERROR: process "pnpm add -g node-gyp" did not complete successfully: exit code: 1
#15 copy /mise/shims
#15 CANCELED
------
> pnpm add -g node-gyp:
11.53 [ERROR] The configured global bin directory "/opt/pnpm/bin" is not in PATH
11.53 Run "pnpm setup" to update your shell configuration.
------
ERROR: failed to build: failed to solve: process "pnpm add -g node-gyp" did not complete successfully: exit code: 1
❌ Railpack build failed

I've tracked the error down to this part, which only gets executed when mise is being used instead of corepack:

if !usingCorepack {
pnpmBinPath := PNPM_HOME
// newer versions of pnpm use a different bin directory
if requestedPnpm := ctx.Resolver.Get("pnpm"); requestedPnpm != nil && usesPnpmBinSubdir(requestedPnpm.Version) {
pnpmBinPath = PNPM_HOME + "/bin"
}
// binaries are installed in the /bin subpath. If this is not added to PATH `pnpm add -g` will fail
install.AddPaths([]string{pnpmBinPath})
install.AddCommand(plan.NewExecCommand("pnpm add -g node-gyp"))
}

Temporal fix that worked for me: add "packageManager": "pnpm@11.5.1" (or whatever version) to your package.json. That forces railpack to use corepack and bypass the buggy code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions