When It Breaks
Five problems cause almost every Week 1 hold-up. Each one below has the exact fix.
Work through this page before you message the group. Your instructor will ask whether you did.
Read the error message first, out loud, slowly. It nearly always says what is wrong. The habit of actually reading errors, rather than panicking at the sight of red text, is worth more than any single fix on this page.
1. claude: command not found
What you see
claude: command not foundWhat it means
The install worked, but your terminal does not know about the new command yet. A terminal only checks for available commands when it starts, so one that was already open never learned about it.
The fix, in order
-
Close your terminal completely and open a new one. Not a new tab - close the window. Then try
claude --versionagain. This fixes it about eight times out of ten. -
Still broken? Restart your laptop. Genuinely. The installer sometimes needs a restart to register.
-
Still broken? Check the install actually succeeded:
npm list -g @anthropic-ai/claude-codeIf nothing is listed, the install failed silently. Run it again and read the output for the word
error:npm install -g @anthropic-ai/claude-code -
If the install itself errors with a permission problem (
EACCESon Mac, or "access denied" on Windows), tell your instructor. Do not start running commands withsudothat you found on the internet - that causes worse problems than the one you are fixing.
2. npm run dev says the port is already in use
What you see
Error: listen EADDRINUSE: address already in use :::3000What it means
Something is already using port 3000. Almost always it is your own site, still running in a terminal window you forgot about.
The fix
First, look for it. Check your other terminal windows and tabs. If you find one running your site, click into it and press Ctrl + C to stop it. Then run npm run dev again.
Cannot find it? Just use a different port:
npm run dev -- -p 3001Then open http://localhost:3001 instead. Nothing is wrong with using another port.
Want to kill whatever is on 3000?
On Mac:
lsof -ti:3000 | xargs killOn Windows PowerShell:
Get-Process -Id (Get-NetTCPConnection -LocalPort 3000).OwningProcess | Stop-Process -ForceCtrl + C is how you stop a running command. It is not "copy" in a terminal. You will use it constantly. Learn it now.
3. GitHub push fails with an authentication error
What you see
remote: Support for password authentication was removed on August 13, 2021.
fatal: Authentication failed for 'https://github.com/...'What it means
GitHub stopped accepting your account password from the command line years ago. Your normal password will never work here. You need a personal access token, which is a long password made specifically for this purpose.
The fix
- Go to github.com/settings/tokens (opens in a new tab)
- Click Generate new token, then Generate new token (classic)
- Give it a name, for example
codezyn laptop - Set Expiration to 90 days - that comfortably covers the course
- Tick the repo checkbox. That is the only one you need
- Click Generate token at the bottom
- Copy the token now. GitHub shows it exactly once. If you lose it, you make a new one
- Run
git pushagain. When it asks for your username, type your GitHub username. When it asks for your password, paste the token
The token will not appear as you paste it. The terminal shows nothing while you type a password - no dots, no stars, nothing. It has gone in. Paste it and press Enter.
Never put a token in your code, in a commit, or in a message to the group. It is a password. If you ever paste one somewhere public, go straight back to that settings page and delete it.
4. The Vercel deployment fails
What you see
A red Failed on the Vercel dashboard, and a wall of build log.
What it means
Vercel tried to build your site and hit an error. The good news is that a failed deploy cannot break your live site - the previous working version stays up.
The fix
First, find the actual error. Click the failed deployment and scroll the build log to the first red line. Not the last one. The first error is the real cause; everything after it is fallout.
Then check the three common causes, in order:
-
It does not build on your laptop either. Stop
npm run devand run this:npm run buildIf that fails locally, the Vercel failure is the same problem. Fix it here, where the feedback is faster.
-
You did not push everything. Run:
git statusIf it lists files in red, they were never committed. Vercel builds only what is on GitHub, not what is on your laptop.
git add . git commit -m "add missing files" git push -
Still stuck? Copy the first red line from the build log and paste it into Claude Code with:
My Vercel deployment failed with this error. What does it mean and how do I fix it?Paste the error underneath.
5. The page shows an error instead of your homepage
What you see
A dark error screen in the browser, often with a red box and a file name, instead of your site.
What it means
The code has a mistake in it. Usually the change that was just made did not quite work.
The fix
Read which file it names. The error screen tells you the file and often the line number. That is the file to talk to Claude about.
Then paste the whole thing back to Claude:
The page is showing this error instead of my homepage. Here is the full error message:
[paste everything from the error screen]
Please explain what is wrong and fix it.If Claude's fix does not work, do not just say "still broken." Say:
That did not fix it. The same error is still showing. Stop making changes and explain what you think is causing this, and what else could be causing it.If it is thoroughly broken and you have a commit, you can go back to your last working version:
git restore .That throws away every uncommitted change and returns you to your last commit. It is a hard undo, and it is exactly why you commit whenever something works.
git restore . cannot be undone. Any work since your last commit is gone. Use it when you are truly stuck, not as a first response.
Still stuck after all of this
Post in the WhatsApp group with these four things. Anything less and somebody has to ask you for them anyway:
- What you were trying to do - "I was pushing to GitHub"
- The exact command you ran - copied, not remembered
- The full error message - a screenshot of the whole terminal is fine
- What you already tried - "I restarted the terminal and checked I was in the right folder"
Nobody in the group thinks less of you for asking. Everybody hits these. The five problems on this page are on this page precisely because they happen to almost every student, every time this course runs.
Next → Week 2 - Design