Repository navigation
Ancient included pnpm 8.15.6 fails out of the box on modern pnpm-workspace.yaml without packages #2149
Description
Companion StackBlitz issue to pnpm issues pnpm/pnpm#14018, pnpm/pnpm#14030 and pnpm/pnpm#15649
Describe the bug
StackBlitz WebContainers include the very old pnpm version 8.15.6, which fails on a valid modern pnpm-workspace.yaml without a packages field with the error message ERR_PNPM_INVALID_WORKSPACE_CONFIGURATION packages field missing or empty
The packages field has been optional since pnpm 10.5.0 (released in Feb 2025), so repositories using modern pnpm configuration can fail automatically when opened in StackBlitz.
Link to the blitz that caused the error
https://stackblitz.com/edit/github-fuwsaec6?file=pnpm-workspace.yaml
Steps to reproduce
- Visit the reproduction URL above
- Observe that pnpm (default installed version on StackBlitz: 8.15.6) fails immediately with the following error message 💥
~/projects/github-fuwsaec6 ❯ pnpm install ERR_PNPM_INVALID_WORKSPACE_CONFIGURATION packages field missing or empty - Check the included pnpm version and observe that StackBlitz is using pnpm 8.15.6
~/projects/github-fuwsaec6 1s ❯ pnpm --version 8.15.6
Attempts to upgrade this version using commands from the pnpm docs fail:
- Attempt to install pnpm by following the Using npm section on the Installation docs page, and observe that the installer fails because
taris unavailable 💥~/projects/github-fuwsaec6 ❯ npx get-pnpm Need to install the following packages: get-pnpm@0.0.3 Ok to proceed? (y) y ==> Downloading pnpm 11.22.0 This installer needs the `tar` command, which was not found on your PATH.
- Attempt to install pnpm 11 directly using npm, and observe that npm cannot write to its default global installation directory
/usr/local/lib/node_modules💥~/projects/github-fuwsaec6 12s ❯ npm install --global pnpm@11 npm error code EACCES npm error syscall mkdir npm error path /usr/local/lib/node_modules/pnpm npm error errno -13 npm error Error { npm error code: 'EACCES', npm error errno: -13, npm error path: '/usr/local/lib/node_modules/pnpm', npm error syscall: 'mkdir', npm error message: "EACCES: permission denied, mkdir '/usr/local/lib/node_modules/pnpm'", npm error stack: "Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/pnpm'" npm error } npm error npm error The operation was rejected by your operating system. npm error It is likely you do not have the permissions to access this file as the current user npm error npm error If you believe this might be a permissions issue, please double-check the npm error permissions of the file and its containing directories, or try running npm error the command again as root/Administrator. npm error A complete log of this run can be found in: /home/.npm/_logs/2026-08-19T16_31_38_032Z-debug-0.log
Installing a usable version of pnpm 10 (pnpm 11 and pnpm 12 do not run on StackBlitz) requires these workarounds:
- Install pnpm 10 using npm, working around the read-only global installation directory by installing into the home directory
~/projects/github-fuwsaec6 1s ❯ npm install --global --prefix "$HOME/.local" pnpm@10 added 1 package in 2s 1 package is looking for funding run `npm fund` for details
- Attempt to run the installed pnpm 10, and observe pnpm can print its version but
pnpm installfails because the project.npmrcdoes not exist (also reported as issuepnpm/pnpm#14030) 💥~/projects/github-fuwsaec6 ❯ "$HOME/.local/bin/pnpm" --version 10.34.5 ~/projects/github-fuwsaec6 ❯ "$HOME/.local/bin/pnpm" install ENOENT ENOENT: no such file or directory, open '/home/projects/github-fuwsaec6/.npmrc'
- Create the missing optional project
.npmrc, retry the install, and observe that the failure now originates from/home/.pnpm/.pnpmfile.cjs💥~/projects/github-fuwsaec6 ❯ touch .npmrc ~/projects/github-fuwsaec6 ❯ "$HOME/.local/bin/pnpm" install WARN Ignoring broken lockfile at /home/projects/github-fuwsaec6/node_modules/.pnpm: ENOENT: no such file or directory, open '/home/projects/github-fuwsaec6/node_modules/.pnpm/lock.yaml' ERR_INVALID_ARG_TYPE The "path" argument must be of type string or an instance of Buffer or URL. Received undefined This error happened while installing a direct dependency of /home/projects/github-fuwsaec6 pnpm [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string or an instance of Buffer or URL. Received undefined at Object.mkdirSync (https://githubfuwsaec6-0c1d-unyik1or.w-credentialless-staticblitz.com/builtins.2896b7f3.js:31:16060) at eval (/home/.pnpm/.pnpmfile.cjs:1:4125) at async fetcher (/home/.local/lib/node_modules/pnpm/dist/pnpm.cjs:116247:16) at async run (/home/.local/lib/node_modules/pnpm/dist/pnpm.cjs:115579:23)
- Inspect StackBlitz's global pnpm configuration and observe that it configures
/home/.pnpm/.pnpmfile.cjs~/projects/github-fuwsaec6 ❯ cat /home/.npmrc update-notifier=false # pnpm options ignore-dep-scripts=true prefer-symlinked-executables=true verify-store-integrity=false global-pnpmfile=~/.pnpm/.pnpmfile.cjs
- Retry with
--ignore-pnpmfileto bypass StackBlitz's global.pnpmfile.cjs, and observe that the install succeeds~/projects/github-fuwsaec6 ❯ "$HOME/.local/bin/pnpm" --ignore-pnpmfile install WARN Ignoring broken lockfile at /home/projects/github-fuwsaec6/node_modules/.pnpm: ENOENT: no such file or directory, open '/home/projects/github-fuwsaec6/node_modules/.pnpm/lock.yaml' Lockfile is up to date, resolution step is skipped Packages: +369 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Progress: resolved 369, reused 0, downloaded 369, added 369, done dependencies: + ansis 4.3.1 + randomcolor 0.6.2 devDependencies: + @types/node 26.1.2 + @types/randomcolor 0.5.9 + @types/styled-components 5.1.36 + eslint 10.8.1 + eslint-config-upleveled 10.0.2 + prettier 3.9.6 + typescript 6.0.3 Done in 7.8s using pnpm v10.34.5
Expected behavior
StackBlitz includes a supported pnpm version that supports modern pnpm-workspace.yaml configuration, including files without a packages field, so pnpm projects install out of the box without StackBlitz-specific workarounds
Parity with Local
- I have run the project in my local machine and I could not reproduce the issue.
Screenshots
(included inline above)
Platform
- OS: macOS Tahoe 26.5.2 (25F84)
- Browser: Chrome
- Version: 151.0.7922.138 (macOS)
Additional context
Related issues:
- Jan 2025:
stackblitz/coreissue from @Mister-Hope requesting pnpm 9/10 support support pnpm v9/v10 core#3237
cc @SamVerschueren if this should be reported some other way or in stackblitz/core, let me know
Activity
bolt-new-by-stackblitz commentedon Aug 20, 2026
karlhorky commentedon Sep 9, 2026
Workaround: Use pnpm 10 on StackBlitz
Use pnpm 10 on StackBlitz out of the box with the following
.stackblitzrcfile:Still would be good to have this work by default though (as well as compatibility for pnpm 11 and 12).