Setting Up Your Node.js Development Environment (Part 2)

![[Node.JS 자동화] Node.js 자동화 프로그래밍, 반복 작업을 AI와 함께 자동화하는 실전 개발(프롤로그)](/uploads/editor/Node-JS-%EC%9E%90%EB%8F%99%ED%99%94-Node-js-%EC%9E%90%EB%8F%99%ED%99%94-%ED%94%84%EB%A1%9C%EA%B7%B8%EB%9E%98%EB%B0%8D-%EB%B0%98%EB%B3%B5-%EC%9E%91%EC%97%85%EC%9D%84-AI%EC%99%80-%ED%95%A8%EA%BB%98-%EC%9E%90%EB%8F%99%ED%99%94%ED%95%98%EB%8A%94-%EC%8B%A4%EC%A0%84-%EA%B0%9C%EB%B0%9C-%ED%94%84%EB%A1%A4%EB%A1%9C%EA%B7%B8-20260702-e78eab.webp)
Why Your Development Environment Matters
Before building a house, you first need to lay a strong foundation.
The same principle applies to programming.
If your development environment isn't properly set up, your programs may fail to run or produce errors.
This is especially true for automation scripts that require multiple libraries and integration with external services. Getting your initial setup right is crucial.
In this lesson, we'll create a standard development environment so everyone can follow along with the same setup.
What Is Node.js?
Node.js is a runtime environment that allows JavaScript to run outside web browsers.
Originally, JavaScript only worked within web browsers.
But with Node.js, developers can now create server-side applications and automation scripts using JavaScript.
Today, countless companies and developers worldwide use Node.js to power various services.
Beyond automation programs, it's also used for:
Web servers
API servers
Chat applications
Real-time notifications
AI programs
Data collection tools
and many other use cases.
What Is npm?
When you install Node.js, it comes with npm (Node Package Manager) by default.
In simple terms, npm is a tool for installing the functionality your program needs.
For example:
To call an API, you need Axios,
To automatically control a web browser, you need Puppeteer or Playwright.
You don't have to download these libraries manually—you can install them with a single npm command.
For instance, installing Axios requires just this command:
npm install axios
This is why npm is an essential tool in Node.js development.
Installing Node.js
You can download Node.js for free from its official website.
When running the installer, most options can be left at their default settings.
Special configurations are rarely needed.
After installation, open Command Prompt or Terminal and enter this command:
node -v
If installed correctly, your current Node.js version will display.
For example, you might see:
v24.5.0
The version number may vary depending on when you install it.
Verifying npm Installation
If Node.js installed correctly, npm will be included automatically.
To verify, enter this command:
npm -v
If properly installed, your npm version number will display.
For example:
11.5.1
This is how it should appear.
Installing VS Code
The most commonly used editor for Node.js development is Visual Studio Code (VS Code).
It's free, lightweight, and supports many extensions—making it popular with both beginners and professionals.
With VS Code, you can:
Write code
Use auto-completion
Debug programs
Integrate with Git
Run terminals
all in one place.
This course will follow along using VS Code as the primary editor.
Creating Your First Project Folder
Let's create a folder for our practice.
You could name it like this:
node-auto
Open this folder in VS Code to begin working.
All future projects will follow this structure.
Creating package.json
In Node.js projects, the package.json file is essential.
This file stores important project information like:
Project name
Version
Used libraries
Execution commands
To create it automatically, run this command:
npm init -y
After running the command, package.json will be created in your project folder.
This file will automatically update whenever you install new libraries.
Running Your First Program
Now let's create a simple program.
Create a file named app.js in your project folder.
Enter this code:
console.log("Hello Node.js");
Then run this command in the terminal:
node app.js
If everything works correctly, you'll see:
Hello Node.js
This is your first Node.js program.
Common Commands You'll Use Often
You'll frequently use these commands when working with Node.js:
Check current Node.js version
node -v
Check npm version
npm -v
Initialize a new project
npm init -y
Install libraries
npm install library-name
Run a program
node filename.js
You'll become familiar with these as we progress through the course—no need to memorize them all now.
Key Libraries We'll Use
In upcoming automation projects, we'll use several libraries:
Axios
MySQL2
OpenAI
Puppeteer
Playwright
node-cron
dotenv
fs
All can be easily installed via npm and are widely used in professional development.
Why Proper Setup Matters
Many beginners look for errors in their code when programs don't run.
But often, the issue is with the development environment instead.
Common problems include:
Mismatched Node.js versions,
Improper npm installation,
Opening the wrong project folder,
Or missing library installations.
Setting up your environment correctly from the start will make following along with future lessons much smoother.
Conclusion
In this lesson, we set up a basic Node.js development environment.
We learned about Node.js and npm's roles, installed VS Code, created our first project, and ran a simple program.
Your setup for automation is now complete.
In the next lesson, we'll explore efficient folder structures and development habits for managing projects. How you structure your projects affects maintainability and scalability significantly—so we'll create a structure commonly used in professional settings.
FAQ
What is Node.js?
Node.js is a runtime environment that allows JavaScript to run outside web browsers, enabling server-side and automation development.
Why is npm important in Node.js development?
npm (Node Package Manager) simplifies installing libraries needed for your projects without manual downloads.
Korean Source
This article is an English localization of a Korean-language report from BlogScore. Original: [Node.JS 자동화] 2강. Node.js 개발 환경 구축하기 (Node.js, npm, VS Code)