English | 한국어
If you have questions while learning, ask on Discord!
- Learn to have Claude execute commands
- Know frequently used terminal commands
- Understand the npm ecosystem
- Understand server concepts and local development environment
- Run and test projects
- Reading: 30 minutes
- Practice: 30 minutes
- Claude Code installed and logged in
- Basic understanding of file handling (Chapter 04)
In Chapter 04, we learned to reference files with @ and create/modify/delete files. Now it's time to learn terminal commands that "bring files to life."
Files alone don't make software work. You need to run commands to install tools, start servers, and test your code. Think of commands as the actions that bring your files to life.
Real-world scenarios:
- You created a website, now you want to see it in your browser
- You need to install a package to add new features
- You want to test if your code works properly
- Your code has an error and you need to debug it
If files are ingredients, then terminal commands are your kitchen appliances.
┌────────────────────────────────────────────┐
│ Kitchen Appliance Analogy │
├────────────────────────────────────────────┤
│ │
│ npm install = Going shopping (getting │
│ ingredients) │
│ npm run dev = Turning on the stove │
│ (starting to cook) │
│ npm test = Taste-testing (checking │
│ if it's good) │
│ npm run build= Packaging (preparing for │
│ delivery) │
│ │
│ You don't need to know how the stove │
│ works internally. You just need to know │
│ "turn it on to cook." │
│ │
└────────────────────────────────────────────┘
You don't need to know how the gas stove works internally. You just need to know "turn it on to cook." Same with commands—Claude knows the details, you just say what you want to happen.
Why do we still use the terminal when we have GUI (graphical interfaces)?
| Aspect | GUI (Graphical) | CLI (Terminal) |
|---|---|---|
| Speed | Mouse movement, clicking | Fast typing |
| Automation | Difficult | Easy with scripts |
| Remote work | Requires screen sharing | Works with text only |
| Precision | Limited | Fine-grained control |
| Server management | Mostly impossible | Essential |
- Efficiency: Same task completed faster
- Automation: Repetitive tasks via scripts
- Server access: Cloud servers have no GUI
- Tool integration: Most dev tools support CLI
- Standard: Developers worldwide use the same approach
💡 Beginner Tip
Don't be afraid of the terminal! With Claude Code, you don't need to memorize commands. Just say "start the server" and that's it.
1960s: Teletype (physical typewriter)
↓
1970s: Terminal screens appear
↓
1980s: Personal computers, DOS
↓
1990s: Windows GUI, but developers keep using terminals
↓
2000s~: Web servers, cloud → terminals become more important
↓
Present: Execute terminal commands in natural language with AI
Claude Code can execute terminal commands on your behalf.
> Show me the files in this folder
Claude runs the ls command and displays the result.
> Check the node version
Claude runs node --version.
> Show everything including hidden files
Claude runs ls -la.
Claude requests confirmation before running commands:
Claude wants to run: ls -la
[Allow] [Deny]
Select Allow to execute.
💡 Beginner Tip
You don't need to memorize terminal commands! Say "show me the file list" and Claude runs
lsfor you. Just speak in natural language.
Adding ! runs the command immediately and shows Claude the result.
> !npm run build
Runs the build; Claude sees the result (success/failure).
> !git status
Checks git status; Claude recognizes the content.
You don't need to memorize these. However, knowing basic commands helps you make more precise requests.
| Command | Function | Natural Language Request | Example |
|---|---|---|---|
ls |
List files | "Show me the file list" | ls -la |
cd |
Change directory | "Move to the src folder" | cd src |
mkdir |
Create folder | "Create a folder called new-folder" | mkdir new-folder |
rm |
Delete file | "Delete this file" | rm file.txt |
cp |
Copy file | "Copy this file" | cp a.txt b.txt |
mv |
Move/rename file | "Rename this file" | mv old.txt new.txt |
pwd |
Check current location | "Where am I now?" | pwd |
| Command | Function | Natural Language Request | Example |
|---|---|---|---|
npm install |
Install packages | "Install the packages" | npm install express |
npm run dev |
Run dev server | "Start the server" | npm run dev |
npm run build |
Build | "Build it" | npm run build |
npm test |
Run tests | "Run the tests" | npm test |
npm init |
Initialize project | "Initialize npm" | npm init -y |
npx |
Execute package | "Run create-react-app" | npx create-react-app my-app |
npm uninstall |
Remove package | "Remove lodash" | npm uninstall lodash |
| Command | Function | Natural Language Request | Example |
|---|---|---|---|
git status |
Check status | "Show git status" | git status |
git add |
Stage changes | "Add the changes" | git add . |
git commit |
Commit | "Commit" | git commit -m "message" |
git push |
Push | "Push" | git push origin main |
| Command | Function | Natural Language Request | Example |
|---|---|---|---|
cat |
View file contents | "Show me the file contents" | cat config.json |
grep |
Search text | "Find error" | grep -r "error" src/ |
🔥 Pro Tip
Don't try to memorize commands. Just ask Claude "tell me common npm commands." Learn naturally by asking when needed.
The - or -- after commands are options.
ls -l # Detailed view
ls -a # Include hidden files
ls -la # Both
npm install --save-dev # Install as dev dependency💡 Beginner Tip
If options confuse you, ask Claude. "What does --save-dev mean in npm install?"
npm (Node Package Manager) is a JavaScript package manager.
┌────────────────────────────────────────────┐
│ npm Ecosystem │
├────────────────────────────────────────────┤
│ │
│ 📦 npm = LEGO Block Store │
│ │
│ - Use code (packages) that others made │
│ - No need to build everything from scratch│
│ - 2+ million packages shared by developers│
│ worldwide │
│ │
│ Examples: │
│ - express: Create web servers │
│ - react: Build UIs │
│ - lodash: Utility functions │
│ - axios: HTTP requests │
│ │
└────────────────────────────────────────────┘
Building from scratch:
Clay → Bricks → House (takes long)
Using npm:
Get LEGO blocks → Assemble → Done (fast)
The core file of every Node.js project.
{
"name": "my-project", // Project name
"version": "1.0.0", // Version
"scripts": { // Runnable commands
"dev": "vite", // npm run dev
"build": "vite build", // npm run build
"test": "vitest" // npm test
},
"dependencies": { // Packages needed to run
"react": "^18.2.0",
"express": "^4.18.0"
},
"devDependencies": { // Packages needed only for development
"typescript": "^5.0.0",
"eslint": "^8.0.0"
}
}💡 Beginner Tip
package.json is the "project description."
- What packages are needed
- What commands to run Everything is written here.
| Command | Meaning | When to Use |
|---|---|---|
npm install |
Install all dependencies | When you first get a project |
npm install <package> |
Install specific package | When adding new features |
npm run <script> |
Run script | Starting server, building, etc. |
npm init -y |
Create new project | When starting a new project |
npm update |
Update packages | When updating to latest versions |
| Category | dependencies | devDependencies |
|---|---|---|
| Meaning | Needed to run | Needed only for development |
| Examples | react, express | typescript, eslint |
| Install | npm install package |
npm install -D package |
| In production | Included | Excluded |
🔥 Pro Tip
"Should this package go in dependencies or devDependencies?" If you're confused, ask Claude!
┌────────────────────────────────────────────┐
│ Server Concept │
├────────────────────────────────────────────┤
│ │
│ Server = A program that receives requests │
│ and sends responses │
│ │
│ [User] → Request → [Server] → Response → │
│ [User] │
│ │
│ Examples: │
│ - Access Google → Google server sends │
│ search page │
│ - Click video on YouTube → Server sends │
│ the video │
│ │
└────────────────────────────────────────────┘
| Category | Local Server | Production Server |
|---|---|---|
| Location | My computer | Cloud (AWS, GCP, etc.) |
| Access | localhost:3000 | www.example.com |
| Purpose | Development, testing | Actual service |
| Security | Only I can access | Worldwide access |
localhost = My own computer
localhost:3000 = Port 3000 on my computer
Think of port numbers as "door numbers":
- Door 3000: Development server
- Door 8080: Another server
- Door 80: Regular web (http)
- Door 443: Secure web (https)
💡 Beginner Tip
Accessing
localhost:3000is like "knocking on door 3000 of your computer." If the server is running, you get a response. If it's off, you can't connect.
# Start dev server (defined in package.json scripts)
npm run dev
# When server starts, you typically see:
# ➜ Local: http://localhost:3000/
# ➜ Network: http://192.168.1.100:3000/Stopping the server:
- Press
Ctrl + C - Closing the terminal also stops the server
> What version of node do I have?
Expected result: Claude runs node --version and shows the version
> Is npm installed?
Expected result: Claude checks and tells you
> Create a folder called test-server
> Initialize npm in that folder
> Install express
> Create index.js. Make it a simple web server that shows "Hello World".
> Run the server
Expected result: Server runs, accessible at http://localhost:3000 in browser
If you get an error:
> I just got an error. What went wrong?
Expected result: Claude analyzes the error cause and suggests solutions
> Create a git repository
> Commit the current changes
Expected result: git init, git add, git commit run in sequence
> Recommend a good package for handling dates
> Install dayjs
> Show me a usage example for dayjs
Claude wants to run command:
npm install express
Allow this action? [y/n/a]
> Run the server
Running: node index.js
Server running at http://localhost:3000
The server has started! Open http://localhost:3000 in your browser.
> Initialize npm
Running: npm init -y
Wrote to /Users/user/test-server/package.json:
{
"name": "test-server",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC"
}
package.json has been created.
Show Answer
Node Package Manager. It's a tool for managing JavaScript packages.
Show Answer
npm install: Installs packagesnpm run dev: Runs the dev command defined in package.json scripts
Show Answer
Port 3000 on my computer (localhost). It's the address for accessing the development server.
Show Answer
Stops the currently running process (e.g., server).
Show Answer
- dependencies: Packages needed to run (e.g., react, express)
- devDependencies: Packages needed only for development (e.g., eslint, typescript)
- Check
node --versionin terminal - Create a new folder and run
npm init -y - Check the contents of
package.json
- Install Express
- Create a simple web server
- Check it in the browser
- Stop the server
- Create an API server with multiple routes
- Add test scripts
- Manage versions with git
- Package exploration: Find and install 5 useful packages from npm
- Script writing: Add custom scripts to package.json
- Deploy preparation: Create a production build with
npm run build
Extend the Hello World server to create a simple API.
> Add an API that responds with { "message": "Hello!" } when accessing GET /api/hello
> Add an API that returns the current time for GET /api/time
> Add an API that returns a random number between 1-100 for GET /api/random
> Make GET /api/greeting?name=John respond with "Hello, John!"
What you see:
bash: node: command not found
Cause: The program is not installed
Solution:
> Install node
Or install directly from nodejs.org
What you see:
Error: EACCES: permission denied
Cause: Permission issue
Solution (Mac/Linux):
> Run it again with sudo
Solution (Windows):
Run PowerShell as administrator
What you see:
Error: ENOENT: no such file or directory
Cause: File or folder doesn't exist
Solution:
> Where am I right now?
> What's in this folder?
What you see:
Error: listen EADDRINUSE: address already in use :::3000
Cause: Another program is using the same port
Solution:
> Find and kill the process using port 3000
Or use a different port:
> Start the server on port 8080
What you see:
Error: Cannot find module 'express'
Cause: Package is not installed
Solution:
> Run npm install
Or:
> Install express
What you see:
npm ERR! code E404
npm ERR! 404 Not Found
Cause: Package name is wrong
Solution:
> Check the package name. Is it react?
What you see:
npm ERR! code EPERM
npm ERR! syscall unlink
Cause: File is being used by another program
Solution:
- Close editors like VS Code
- Delete node_modules folder and reinstall:
> Delete node_modules and run npm install again
What you see:
npm WARN deprecated package@1.0.0: this package is deprecated
Meaning: Just a warning, not an error
Solution:
- Can usually be ignored
- If there's a newer alternative:
> What should I use instead of this deprecated package?
What you see:
SyntaxError: Unexpected token '}'
Cause: Code syntax error
Solution:
> Fix this error. It says SyntaxError.
What you see:
npm ERR! missing script: start
Cause: That script doesn't exist in package.json
Solution:
> What scripts are in package.json?
Then use the correct script name
> Where am I now?
Always check your location.
⚠️ Warning
npm installmust be run in the folder with package.json. Running it in a different folder creates a new package.json.
Commands like npm install take time. Wait until you see the completion message.
In progress:
[##########........] 50%
Complete:
added 52 packages in 3s
When you first open a project:
> npm install
must be run first.
💡 Beginner Tip
Always run
npm installfirst when you get a new project! Otherwise you'll get "module not found" errors.
The server needs the terminal to stay open to keep running.
Wrong way:
Start server → Close terminal → Server stops
Right way:
Start server → Keep terminal open → Work in another terminal tab
Copy the error message and show it to Claude. It contains useful information.
> Look at this error message:
> Error: Cannot find module 'lodash'
> sudo npm install (not recommended)
→ If you have permission issues, find other solutions first.
Add node_modules to .gitignore!
→ It's large and can be regenerated with npm install.
| Symptom | Solution |
|---|---|
| "command not found" | Program needs to be installed |
| "permission denied" | Use sudo or check permissions |
| "ENOENT" | Check file/folder path |
| "port already in use" | Kill other process or change port |
| Server won't start | Check error message, verify dependencies installed |
| Not showing in browser | Check if server is running, try Ctrl+F5 to refresh |
| npm install fails | Check internet connection, delete node_modules and retry |
# 1. Clone repository
git clone https://github.com/example/project.git
# 2. Change directory
cd project
# 3. Install dependencies
npm install
# 4. Start dev server
npm run dev# Morning: Get latest code
git pull
# Start dev server
npm run dev
# Develop new features...
# Test
npm test
# Commit
git add .
git commit -m "Add new feature"
git push# Lint check
npm run lint
# Test
npm test
# Build
npm run build
# Preview build result
npm run previewCheck before finishing your learning:
- I can ask Claude to execute commands
- I know what the
!prefix does - I know the difference between npm install and npm run
- I know what package.json is
- I can create and run a simple server
- I can ask Claude for help when I get errors
- I know what localhost is
| Term | Description |
|---|---|
| npm | Node Package Manager. A package management tool |
| Package | A reusable bundle of code |
| package.json | Project configuration file |
| dependencies | List of packages needed to run |
| devDependencies | List of packages needed only for development |
| Server | A program that receives requests and sends responses |
| localhost | Address that refers to your own computer |
| Port | Door number for network communication |
Also refer to the full glossary.
Official Documentation:
- npm Official Documentation - Complete npm guide
- Node.js Official Documentation - Node.js API documentation
Video Resources:
- npm Tutorial for Beginners (YouTube) - npm basics tutorial
- Express.js Crash Course (YouTube) - Express quick start
- Git Tutorial (YouTube) - Git basics
Reading Materials:
- JavaScript.info - JavaScript tutorial
- Express.js Official Guide - Getting started with Express
Useful Tools:
- npm Package Search - Find npm packages
- npx Guide - Run packages directly
Congratulations! You've completed Part 1 (Getting Started).
What you've learned:
- AI coding and vibecoding concepts
- Claude Code installation and login
- Permission modes and basic conversation
- File creation, modification, and reference
- Terminal command execution
- npm ecosystem and server concepts
What you can do now:
- Create files while chatting with Claude
- Run simple web servers
- Request error resolution
- Install and use packages
In the next Part, we'll learn Claude Code's core features in depth!
In the next chapter, you'll learn how to understand and analyze project structure.
Next chapter preview:
- Analyzing project structure
- Understanding dependency relationships
- Codebase exploration strategies
Proceed to Chapter 06: Understanding Project Structure.
Built with ❤️ by Hashed