Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
freem
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Openai/696bccda-36cc-8000-b805-9be682a21332
(section)
Add languages
Page
Discussion
English
Read
Edit
Edit source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
Edit source
View history
General
What links here
Related changes
Special pages
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==== 1) Make sure they’re in the right folder ==== In a terminal inside the project root (the folder that contains package.json), run: * Windows (PowerShell/cmd): ``<code>bash dir <syntaxhighlight>- Mac/Linux: </syntaxhighlight>bash ls <syntaxhighlight> They should see a package.json. If not, they’re one directory too high/low. ==== 2) Reinstall dependencies (this is the most likely fix) ==== When you download/replace a repo folder, it usually does not include </code>node_modules/<code>, and without it Next won’t exist locally. Run: </syntaxhighlight>bash npm install <syntaxhighlight> Then try again: </syntaxhighlight>bash npm run dev <syntaxhighlight> If that works, done. ==== 3) If it still says “next not recognized”, verify Next exists in dependencies ==== Open package.json and look for something like: </syntaxhighlight>json "dependencies": { "next": "...", "react": "...", "react-dom": "..." } <syntaxhighlight> If </code>next<code> is missing, then the repo/version they restored to doesn’t include it (or they restored the wrong folder). ===== Fix: install Next (and React if needed) ===== Run: </syntaxhighlight>bash npm i next react react-dom <syntaxhighlight> Then: </syntaxhighlight>bash npm run dev <syntaxhighlight> ==== 4) Make sure npm run dev is actually calling Next correctly ==== In package.json, confirm scripts look like: </syntaxhighlight>json "scripts": { "dev": "next dev", "build": "next build", "start": "next start" } <syntaxhighlight> If dev points to something else, that could be the issue. ==== 5) If they used Cursor / agents, also check Node version ==== Next projects can fail if Node is too old. Check: </syntaxhighlight>bash node -v npm -v <syntaxhighlight> If Node is old (common issue on Windows), install a current LTS (Node 18 or 20+ usually). ==== 6) The right way to “restore an earlier GitHub version” (so it doesn’t happen again) ==== Instead of downloading a zip and replacing folders, do this: ===== If they already have the repo locally ===== </syntaxhighlight>bash git log --oneline <syntaxhighlight> Find the commit hash of the last good version, then: </syntaxhighlight>bash git checkout <commit-hash> npm install npm run dev <syntaxhighlight> (That puts them in a “detached HEAD” state, but it’s perfect for recovery/testing.) If they want to restore and continue work from there: </syntaxhighlight>bash git checkout -b restore-working <syntaxhighlight> ===== If they don’t have it locally ===== Clone fresh: </syntaxhighlight>bash git clone <repo-url> cd <repo-folder> npm install npm run dev <syntaxhighlight> ==== 7) Quick diagnostic checklist (what I’d ask them to paste) ==== If they’re still stuck, have them paste: # The </code>package.json<code> scripts section # The output of: </syntaxhighlight>bash where next <syntaxhighlight> (Windows) or </syntaxhighlight>bash which next <syntaxhighlight> (Mac/Linux) # The output of: </syntaxhighlight>bash npm run dev </code>`<code> (full error) ===== Likeliest outcome ===== They replaced the folder and didn’t run </code>npm install`, so Next isn’t present locally → next not recognized. If you want, paste their package.json scripts + the exact error text and I’ll tell you exactly which branch of the fix applies.
Summary:
Please note that all contributions to freem are considered to be released under the Creative Commons Attribution-ShareAlike 4.0 (see
Freem:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)