Prerequisites
Before running any lesson, ensure you have:Node.js installed
You need Node.js version 18 or higher.Check your version:If you see
v18.0.0 or higher, you’re good to go.Don’t have Node.js? Download it from nodejs.orgA code editor
We recommend VS Code, but any code editor works.
Running Your First Lesson
Navigate to a lesson folder
Open your terminal and navigate into any lesson folder. Let’s start with the first one:
Install dependencies
Every lesson needs its dependencies installed first. Run:This command:
- Reads the
package.jsonfile - Downloads all required packages (React, Next.js, etc.)
- Creates a
node_modulesfolder with the packages
You only need to run
npm install once per lesson (unless you add new dependencies later).Making Changes & Hot Reloading
One of the best features of Next.js is hot reloading - your changes appear instantly in the browser without refreshing.Try It Yourself
Open the code in your editor
With the dev server still running, open the lesson folder in your code editor.
Understanding npm Scripts
Each lesson’spackage.json defines several useful scripts:
When to Use Each Command
| Command | Use Case |
|---|---|
npm run dev | Daily development work |
npm run build | Before deploying to production |
npm run start | Running production build locally |
Working with Multiple Lessons
You can run multiple lessons simultaneously, but they’ll conflict on port 3000.Solution 1: Stop Previous Server
PressCtrl+C in the terminal to stop the current server, then start a different lesson.
Solution 2: Use Different Ports
- Lesson 1:
http://localhost:3000 - Lesson 3:
http://localhost:3001
Navigating Between Pages
Lessons with multiple pages (Lesson 2 onwards) have navigation:The URL path matches the folder structure in
app/:app/page.js→/app/pricing/page.js→/pricingapp/about/page.js→/about
Troubleshooting Common Issues
Port 3000 Already in Use
Error:Option 1: Kill the process using port 3000
Option 1: Kill the process using port 3000
Mac/Linux:Windows:
Option 2: Use a different port
Option 2: Use a different port
http://localhost:3001Module Not Found Errors
Error:npm install. Install dependencies:
Changes Not Appearing
Problem: You saved changes but don’t see them in the browser. Solutions:Syntax Errors
Error:- Check the terminal - it shows which file has the error
- Look at the line number mentioned
- Common issues:
- Missing closing bracket
} - Missing closing parenthesis
) - Missing closing tag
</div>
- Missing closing bracket
Cannot Access localhost
Problem: Browser shows “This site can’t be reached” Solutions:Check if server is running
Check if server is running
Look at your terminal - do you see:If not, the server isn’t running. Start it with
npm run dev.Check the URL
Check the URL
Make sure you’re visiting exactly:Not:
https://(http, not https)localhoat(typo)127.0.0.1(use localhost)
Try a different browser
Try a different browser
If Chrome doesn’t work, try Firefox or Safari.
Dependencies Installation Failed
Error:- Check your internet connection
- Try clearing npm cache:
- Delete
node_modulesandpackage-lock.json, then reinstall:
Development Best Practices
Keep Dev Server Running
Check Terminal for Errors
Always keep your terminal visible. Next.js shows helpful error messages there.Save Files Frequently
Get in the habit of saving (Cmd+S / Ctrl+S) after every small change to see results immediately.
Read Error Messages
Next.js error messages are beginner-friendly:- They show the exact file and line number
- They often suggest how to fix the issue
- They highlight the problematic code
Quick Reference
Essential Commands
File Locations
| File | Purpose |
|---|---|
app/page.js | Home page - start editing here |
app/layout.js | Wraps all pages (navbar, fonts, etc.) |
package.json | Lists dependencies and scripts |
node_modules/ | Installed packages (auto-generated) |
Keyboard Shortcuts
| Action | Mac | Windows/Linux |
|---|---|---|
| Save file | Cmd+S | Ctrl+S |
| Stop server | Ctrl+C | Ctrl+C |
| Hard refresh | Cmd+Shift+R | Ctrl+Shift+R |
Next Steps
Now that you can run lessons, learn how to customize them for your own SaaS:Customize Lessons
Adapt the code to build your own unique SaaS product