What is Node.js?
Node.js lets you run JavaScript outside of a web browser. Without it, JavaScript can only run inside a browser tab. With it, you can run JavaScript files from your terminal, use build tools, and install packages. You need Node.js for two things in this course:- Running JavaScript files during the learning sections
- Running React’s development server when you build UIs
Node.js also comes with npm (Node Package Manager), which you’ll use to install libraries like React. You get both when you install Node.js.
Installation
- macOS
- Windows
- Linux
The easiest way is with Homebrew:If you don’t have Homebrew, install it first from brew.sh, or download the installer directly from nodejs.org.
Verifying installation
Open your terminal and run these two commands:Quick test
Let’s make sure Node.js actually works. Type this directly in your terminal:-e flag lets you run a one-line JavaScript command without creating a file. You’ll create proper files in the next lessons.
What’s next?
Node.js is installed. Now let’s set up VS Code with the right extensions for JavaScript development.Setting up VS Code
Configure your editor for JavaScript