Skip to main content

create-next-app-existing-dir

When running create-next-app in an existing directory (e.g. backend/): remove or rename existing package.json if the tool refuses to overwrite; prefer absolute path for target; for API-only setups, strip UI (layout, page, globals, public) and clear .next before re-running type-check. Use when scaffolding Next.js in an existing folder.

Quellinformationen

Repository
pmarashian/cursor-agent-skills
Letzte Quellaktivität
13. Februar 2026 um 19:51
Erkannte Sprache von SKILL.md
Englisch
Sterne
2
Forks
1

Installationsoptionen

Standardmäßig ist der Prompt ausgewählt, der zuerst die Quelle prüft. Sie können zu einem direkten Befehl wechseln oder eine lokale Kopie herunterladen.

Quelldateien prüfen

Lesen Sie SKILL.md und alle von SkillsMP angezeigten Begleitdateien, bevor Sie sich für eine Installation entscheiden.

SKILL.md wird angezeigt

SKILL.md
Quellanweisungen · Schreibgeschützte Vorschau
name
create-next-app-existing-dir
description
When running create-next-app in an existing directory (e.g. backend/): remove or rename existing package.json if the tool refuses to overwrite; prefer absolute path for target; for API-only setups, strip UI (layout, page, globals, public) and clear .next before re-running type-check. Use when scaffolding Next.js in an existing folder.
# Create-Next-App in Existing Directory When running create-next-app **inside an existing directory** (e.g. `backend/`): ## Checklist 1. **Existing package.json**: If the tool refuses to overwrite, remove or rename the existing `package.json` in that directory before re-running. 2. **Target path**: Prefer an **absolute path** for the target directory to avoid `cd`/sandbox issues. 3. **API-only setup**: For API-only backends, after scaffolding: strip UI (layout, page, globals, public) as needed and clear `.next` before re-running type-check. ## Optional - Link to **monorepo-backend-layout** so the agent treats the backend directory as the app root. ## Why This Matters Tasks have lost ~20–25 seconds to create-next-app retries (existing package.json, then path issues). A short checklist prevents repeated failures.
Auf GitHub ansehen