For Workers & Pages, what is the name of the domain?
thetableapp-tasks.fidel-elie.workers.dev
What is the error number?
N/A
What is the error message?
20:07:26.010 pnpm: EMFILE: too many open files, open ‘/opt/buildhome/repo/apps/tasks/node_modules/esbuild-register/package.yaml’ 20:07:26.010 at async open (node:internal/fs/promises:638:25) 20:07:26.013 at async Object.readFile (node:internal/fs/promises:1238:14) 20:07:26.013 at async readPackageYaml (/opt/buildhome/.cache/node/corepack/v1/pnpm/9.11.0/dist/pnpm.cjs:18248:16) 20:07:26.013 at async tryReadProjectManifest (/opt/buildhome/.cache/node/corepack/v1/pnpm/9.11.0/dist/pnpm.cjs:18168:26) 20:07:26.013 at async readProjectManifest (/opt/buildhome/.cache/node/corepack/v1/pnpm/9.11.0/dist/pnpm.cjs:18123:23) 20:07:26.013 at async readProjectManifestOnly (/opt/buildhome/.cache/node/corepack/v1/pnpm/9.11.0/dist/pnpm.cjs:18130:28) 20:07:26.014 at async safeReadProjectManifestOnly (/opt/buildhome/.cache/node/corepack/v1/pnpm/9.11.0/dist/pnpm.cjs:18114:16) 20:07:26.014 at async getPackageBins (/opt/buildhome/.cache/node/corepack/v1/pnpm/9.11.0/dist/pnpm.cjs:105364:52) 20:07:26.014 at async /opt/buildhome/.cache/node/corepack/v1/pnpm/9.11.0/dist/pnpm.cjs:105296:22 20:07:26.014 at async Promise.all (index 0) 20:07:26.257 Failed: error occurred while installing tools or dependencies
What is the issue or error you’re encountering
Worker fails to deploy with confusing error using wrangler I have another server that has deployed fine with a similar configuration.
What are the steps to reproduce the issue?
Deploy a cloudflare worker with a these config using pnpm
So I think I may have found a way to fix this. it looks like when the cloudflare builder runs the install command it runs it in the root pacakge so ends up installing everything. So instead:
Override the builder so it doesn’t run the install dependencies command itself. To do this, add SKIP_DEPENDENCY_INSTALL=true as a build environment variable to the worker. This can be done in setting or when creating it for the first time.
Set the build command for the worker to whatever your preferred dependency install command is for me it was just pnpm install.
The error would not come up on a rebuild for me a lot of the time if I triggered this from the dashboard but when pushing new code to the repo branch and triggering a new build that way it would fail consistently with this error.