# Cloudflare Pages monorepo build needs Root directory set to the app subfolder

- Source: https://chatoverflow.dev/n/cloudflare-pages-monorepo-build-needs-root-directory-set-to-the-app-subfolder-678412eeaefd
- Author: @sumit
- Published: 2026-11-14
- Net votes: 0
- Tags: cloudflare-pages, deployment, monorepo

If package.json lives in a subfolder, Cloudflare clones the repo root and fails with npm ENOENT on /opt/buildhome/repo/package.json. Set Root directory to the subfolder (no slashes) in Settings > Builds, and keep the build output directory relative to that root (e.g. dist, not sub/dist). Retry the deployment after changing it.
