Choose an LTS release for stable learning and install it using the official Node.js installer, Homebrew, winget, nvm, or fnm. Compare when a simple installer is enough and when a version manager is safer for future projects.
Run `node -v` and `npm -v` to confirm both tools are available from your terminal. Recognize what the `PATH` setting does when a command works, fails, or points to the wrong version.
Check what you understood with a short quiz.
Use what you learned in the previous lesson to solve real-world problems.
Use the terminal prompt to run commands, pass arguments, and understand the current working directory. Practice `pwd`, `cd`, `ls` or `dir`, and `mkdir` to create and enter a project folder.
Open a project folder in Visual Studio Code, create files, and use the integrated terminal without switching apps. Set up a clean workspace that keeps code, terminal output, and file navigation together.
Create a `.js` file, write a small `console.log()` statement, save it, and run it with `node filename.js`. Trace the simple path from source file to terminal output.
Use the Node.js REPL for quick experiments and script files for saved, repeatable programs. Try a few expressions in `node`, exit the REPL, then move the same idea into a file.
Create `package.json` with `npm init` or `npm init -y` and read the fields npm adds to a project. Understand why Node projects keep metadata, scripts, and dependency records in this file.
Add a `start` script to `package.json` and run it with `npm start` or `npm run`. See how npm scripts give a project a standard command even when the underlying Node command is longer.
Install a small package with `npm install` and inspect `node_modules`, `package.json`, and `package-lock.json`. Reason through what npm changes locally and why committed projects usually keep the lockfile but not `node_modules`.
Read a syntax error by finding the file name, line number, column, and highlighted token. Fix common first-script mistakes such as missing quotes, parentheses, or braces, then rerun the file.
Read runtime errors such as `ReferenceError` and `TypeError` by using the message and stack trace. Follow the top stack frame back to the line that crashed and separate the cause from the surrounding call history.
Use `console.log()` to inspect values, mark which branch of code ran, and compare expected output with actual output. Remove or refine debug prints once the problem is understood.
Make one small change, save the file, rerun the same command, and interpret the new output or error. Practice the tight edit-run-debug loop used in everyday Node.js development.
Start a Node program from VS Code’s Run and Debug panel, set a breakpoint, step through code, and inspect variables. Use the debugger when repeated `console.log()` statements are slower than pausing the program directly.
Recognize common setup differences between PowerShell, Command Prompt, zsh, and bash, including path separators, quoted folder names, and command aliases. Adjust examples so the same Node project runs on Windows, macOS, or Linux.
Review this chapter with practice based on your mistakes.