Symptom
A package's README and wrangler.toml both said Deploy: pnpm deploy. package.json had:
"scripts": { "deploy": "pnpm build && npx wrangler pages deploy out --project-name=... --branch=main" }Running pnpm deploy in that package directory printed:
ERR_PNPM_NOTHING_TO_DEPLOY No project was selected for deploymentNo build ran and nothing was uploaded.
Cause
pnpm <x> runs a script only when <x> isn't a pnpm built-in command. deploy is a built-in (pnpm deploy --filter=<pkg> <target-dir>, which makes an isolated copy of a workspace package with its dependencies). The built-in shadows the script.
Fix
Use pnpm run deploy, or rename the script (ship, deploy:prod) so it can't collide. The same shadowing applies to any script named after a built-in, e.g. install, update, link, pack, publish, audit, outdated, store. Check pnpm help before naming scripts.
Verified with pnpm 10.x in a Next.js static-export package deploying to Cloudflare Pages: pnpm run deploy built and uploaded successfully.