NodeJSEditor & Dev Environment Setup

Editor & Dev Environment Setup

A good setup makes Node development faster and catches mistakes before you run anything. You can use any editor, but Visual Studio Code is the de facto standard for Node.js because of its built-in JavaScript/TypeScript intelligence (powered by the same tsserver that ships with TypeScript) and its first-class Node debugger.

Visual Studio Code

Download it from code.visualstudio.com. Out of the box you get autocompletion (IntelliSense), inline type checking for plain JS, and an integrated terminal. The extensions worth adding:

Extension

What it gives you

ESLint

Flags bugs and anti-patterns as you type

Prettier

Auto-formats on save so the whole team matches

Error Lens

Shows errors/warnings inline next to the code

npm Intellisense

Autocompletes module names in require/import

DotENV

Syntax highlighting for .env files

ESLint and Prettier do different jobs
**ESLint** finds *problems* (unused vars, `==` vs `===`, unreachable code); **Prettier** fixes *formatting* (quotes, spacing, line width). They are complementary — let Prettier own layout and ESLint own correctness, so they never fight over the same rules.
Format on save

Add this to VS Code's settings so Prettier formats every file on save and ESLint auto-fixes what it can:

.vscode/settings.json

JSON
{
  "editor.formatOnSave": true,
  "editor.defaultFormatter": "esbenp.prettier-vscode",
  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": "explicit"
  }
}
Commit .vscode/settings.json
Putting these in the project's `.vscode/settings.json` (not just your global settings) means every teammate gets the same behaviour automatically — no "works on my machine" formatting churn in diffs.
Type-checking plain JavaScript

You can get TypeScript-level error catching without converting to .ts. Add a jsconfig.json and a // @ts-check comment, and the editor will type-check your JS using JSDoc:

JS
// @ts-check
/** @param {number} a @param {number} b */
function add(a, b) {
  return a + b
}
add('1', 2)   // editor flags: Argument of type 'string' is not assignable
Debugging instead of console.log

VS Code attaches a real debugger to Node — breakpoints, step-through, variable inspection. The simplest entry is the JavaScript Debug Terminal: open it from the command palette and any node command you run there is debuggable. Or commit a launch config:

.vscode/launch.json

JSON
{
  "version": "0.2.0",
  "configurations": [
    {
      "type": "node",
      "request": "launch",
      "name": "Debug app.js",
      "program": "${workspaceFolder}/app.js"
    }
  ]
}

The full story — breakpoints, the inspector protocol, Chrome DevTools — is in Debugging Node.js.

The integrated terminal

Open it with **Ctrl + ** (backtick). Running node, npm`, and your scripts here keeps everything in one window, and VS Code picks up the Node version from your version manager.

A minimal project skeleton

Most Node projects start the same way:

Bash
mkdir my-app && cd my-app
npm init -y                      # creates package.json
git init                         # start version control
printf "node_modules\n.env\n" > .gitignore
Always gitignore node_modules and .env
`node_modules` can hold tens of thousands of files and is fully reproducible from `package.json` + the lockfile — never commit it. `.env` holds secrets — never commit it either (see [Environment Variables](/nodejs/process-env)).
Other good editors
  • WebStorm — a full IDE with deep Node/JS support and a great debugger (paid).

  • Neovim / Vim — with the LSP (tsserver) for terminal lovers.

  • Cursor / Zed — modern editors with built-in AI assistance.

Next
Your environment is ready. Write the classic [Hello World in Node.js](/nodejs/hello-world).