Skip to content

Environment Setup

Set up your development environment: installing a language runtime, editor, and tools to start coding effectively.

What you'll learn

  • What a development environment is and its key components
  • How to install a language runtime (Node.js, Python, etc.)
  • Choosing and configuring a code editor or IDE
  • Package managers and installing project dependencies
  • Verifying your setup with a first running program

Concept

Environment Setup

A development environment is the collection of tools on your computer that lets you write, run, and test code. Before you can program, you need three things: a language runtime (the engine that executes your code), a code editor (where you write the code), and a package manager (to install libraries). Setting these up correctly is a one-time investment that pays off every day.

Installing a Language Runtime

A runtime is the software that executes your code. For JavaScript outside the browser, that runtime is Node.js. For Python, it is the Python interpreter. You download the runtime from the official website, run the installer, and verify it works:

# After installing Node.js, verify:
node --version    # e.g., v20.10.0
npm --version     # e.g., 10.2.3

# After installing Python, verify:
python --version  # e.g., Python 3.12.0

If these commands print version numbers, the runtime is installed and accessible from your terminal. If you get "command not found," the installation did not add the tool to your system path — a common issue with a known fix for each operating system.

Choosing a Code Editor

A code editor is where you write your programs. The most popular choice today is Visual Studio Code (VS Code) — it is free, lightweight, and has a rich ecosystem of extensions. Key features to configure:

  • Syntax highlighting — colors that make code structure visible.
  • Auto-completion — suggests names as you type.
  • Integrated terminal — run commands without leaving the editor.
  • Debugger — set breakpoints and step through code.
  • Extensions — add language support, linters, and formatters.

An IDE (Integrated Development Environment) like WebStorm or PyCharm includes more features out of the box but is heavier. For beginners, VS Code is the best starting point.

Package Managers

A package manager installs third-party libraries (called packages or dependencies). For Node.js, it is npm (installed with Node) or pnpm. For Python, it is pip. You use it to install libraries that others have published, so you do not have to reinvent the wheel:

npm install axios         # install a library for HTTP requests
pip install requests      # same concept, for Python

The package manager downloads the library, resolves its own dependencies, and makes it available to your code via import.

Verifying Your Setup

After installation, write a tiny program to confirm everything works end-to-end:

# Create a file: hello.js
echo 'console.log("Setup works!")' > hello.js
node hello.js             # should print: Setup works!

If that runs, your environment is ready. You have a runtime, an editor, and a package manager — the three pillars of development. From here, every project you start builds on this foundation.

Example

              # Step 1: Check if Node.js is installed
node --version
# If not found, download from https://nodejs.org and install

# Step 2: Check npm (comes with Node.js)
npm --version

# Step 3: Create a project directory
mkdir my-first-project
cd my-first-project

# Step 4: Initialize a new Node.js project
npm init -y
# This creates package.json — the project's config file

# Step 5: Install a useful library
npm install chalk    # a library for colored terminal output

# Step 6: Write your first program
cat > index.js << 'EOF'
import chalk from "chalk";
console.log(chalk.green("Environment setup complete!"));
console.log(chalk.blue("You are ready to code."));
EOF

# Step 7: Run it
node index.js
# Output (in green): Environment setup complete!
# Output (in blue):  You are ready to code.
            

This is a complete environment setup script: check the runtime, create a project, initialize it, install a dependency, write a program, and run it. If all steps succeed, your development environment is fully functional.

Try it

  • Dockerfile Generator

    Docker creates reproducible development environments. Generate a Dockerfile to see how environments are defined as code.

  • Environment File Generator

    Environment variables configure your setup. Generate .env files to understand how environment configuration works.

Common mistakes

The mistake

Installing the runtime but not verifying it is on the system PATH.

The fix

After installation, run node --version or python --version in the terminal. If you get 'command not found', the tool is not on your PATH. Reinstall and check the 'Add to PATH' option, or manually add the install directory.

The mistake

Installing global packages when project-local packages are more appropriate.

The fix

Use npm install <package> (local) for project dependencies, not npm install -g <package> (global). Global packages are harder to manage and can cause version conflicts between projects.

The mistake

Using an outdated runtime version that lacks modern features.

The fix

Check for LTS (Long Term Support) versions. Node.js LTS versions are even-numbered (18, 20, 22). Use a version manager like nvm or fnm to switch versions per project.

Related Cheatsheets

  • Bash Cheatsheet

    Terminal commands for managing your development environment and installed tools.

Look up unfamiliar terms

A beginner-friendly glossary explains jargon in plain English — variables, functions, DOM, Promise, and more.

View glossary

Build real projects

Apply what you learned by building guided projects with starter code and solutions.

View projects

Decode error messages

Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.

View errors