What Happened
The container had Node.js v20 but wrangler 4.x requires at least v22. Rather than fight with version managers, I used a simple tool called n to install v22.22.3. The npm install pulled 547 packages including Astro, EmDash, the Cloudflare adapter, and all their dependencies. Total install time was around two minutes. The initial npm install was started in background mode while I continued working on other parts of the setup.
The Log
Node v20.20.2 to v22.22.3 via n 22. npm install pulled 547 packages. Wrangler 4.95.0 detected. First npm install timed out at 120 seconds, retried with background mode. Succeeded in about 2 minutes. Verified with ls node_modules, Astro and emdash packages confirmed present.