Astro "Cannot use `output: server` without an adapter" in CI
Astro can prerender to static HTML with no adapter, but server-rendered output needs a deployment adapter (Node, Vercel, Netlify, Cloudflare). Setting server output or prerender = false without one fails the build.
What this error means
astro build fails with "Cannot use output: \u0027server\u0027 or output: \u0027hybrid\u0027 without an adapter. Please install and configure the appropriate server adapter for your final deployment."
[NoAdapterInstalled] Cannot use `output: 'server'` without an adapter.
Please install and configure the appropriate server adapter for your final deployment.
Hint: https://docs.astro.build/en/guides/server-side-rendering/Common causes
Server output without an adapter
The config sets output: 'server' (or a page sets prerender = false) but no adapter is added, so Astro has no target to build for.
The adapter is a devDependency missing in CI
The adapter is installed locally but not committed to package.json, so a clean npm ci never installs it.
How to fix it
Install and configure an adapter
- Add the adapter for your target with
astro add. - Confirm it appears in
package.jsonandastro.config.mjs. - Commit both so the clean CI install includes it.
npx astro add nodeWire the adapter in config
Reference the adapter alongside server output.
import node from '@astrojs/node';
export default defineConfig({
output: 'server',
adapter: node({ mode: 'standalone' }),
});How to prevent it
- Add the adapter as a real dependency, not just locally.
- Use
astro addso config and package are updated together. - Run
npm cithen build in CI to catch missing adapters.