Fix · Node, npm and build
Strange errors after changes: clean caches and reinstall
What you may see
- The same code gives different errors, or old errors keep coming back
- I switched branches or Node versions
Most likely cause
Generated folders (.next, dist, node_modules) can hold leftovers from another version of the project.
Check first (about two minutes)
- Confirm there are no unsaved edits you would lose (git status).
The fix prompt
What you type here never leaves your browser. The search runs on this page, and nothing is sent to a server or to an AI.
Kept only in this browser, on this device. Keys and passwords are removed before anything is saved.
Prompt language
Paste it into Claude, ChatGPT, Gemini or Cursor, then follow what it says.
After you tried it, did it work?
Steps
- Run git status first and tell me if anything unsaved could be lost.
- Delete only the generated folders (.next, dist, build cache) and keep my source files and .env.
- If it persists, remove node_modules and run npm ci (from the lock file), not a fresh npm install.
- Start the dev server again and test.
Do not do this
- Do not make this the first answer to every error: read the error first.
- Do not delete package-lock.json, .env, or any source folder.