Next.js build fails because no pages or app directory is at the project root

Error recorded 1 times in PanelAlpha Engine deploys on Nextjs. The deploy log below is the recorded failure output.

Seen1 times
WhereNextjs

Why it happens

The Next.js strategy started from a project root that does not contain a pages or app directory. This commonly happens when the Next.js app is inside a subdirectory or when the repository is not a standard Next.js app. The deployment also fell back to installing Next.js with npm exec, despite the project using pnpm.

What the log looks like

Deploy log
Done in 1m 38.3scp: cannot stat '/app/package-lock.json': No such file or directorynpm warn exec The following package was not found and will be installed: [email protected]▲ Next.js 16.3.5 (Turbopack)> Build error occurredError: > Couldn't find any `pages` or `app` directory. Please create one under the project rootDeploy failed: Failed to start app

Try PanelAlpha Engine yourself.

The easiest way to turn your server into a safe, controlled environment for your AI agent. Deploy, manage and maintain any project from Claude Code, Cursor, Codex or any other MCP client. Open source under Apache 2.0, free to run.

Requires Ubuntu 24.04 or 26.04 · 2 GB RAM · 1 CPURead the documentation