Setup: Node + npm, Running .js, DevTools Console
Install Node, verify versions, run .js files, learn npm basics, and practice with the browser DevTools console.
Setup: Node + npm, Running .js, DevTools Console is a free JavaScript Academy lesson on CoddyKit — lesson 2 of 3. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the JavaScript Academy learning path, one of 3 lessons in the course, and your progress syncs across the web and the CoddyKit app.
Intro
Goal: Set up Node and npm, run a .js file, and use the browser's DevTools Console.
- Install & verify Node
- npm basics
- Run .js files
- Use console tools
Verify Node & npm
Verify: In a terminal, run node -v and npm -v. If versions appear, your setup is ready.
Create & run a file
Create hello.js and run it with node hello.js.
// hello.js — minimal program to run with Node
function greet(name) {
return "Hello, " + name + "!";
}
const message = greet("CoddyKit");
console.log(message);
// Run from terminal in this folder: node hello.js
npm quickstart
Inside a project folder, run npm init -y to create package.json. Add a script: "start": "node hello.js". Then run npm run start.
Console tools
Use console.log, console.table, and console.time to inspect and measure small tasks.
// Basic console utilities that work in Node and browsers
const user = { name: "Ayla", level: 1 };
console.log("User:", user);
console.table([{ key: "name", value: user.name }, { key: "level", value: user.level }]);
console.time("work");
for (let i = 0; i < 100000; i++) {}
console.timeEnd("work");
console.warn("Heads up: demo complete.");
DevTools basics
Open DevTools (F12 or right-click → Inspect) and switch to Console. Paste small snippets, press Enter, and read the output. Tip: clear with clear().
Node version quiz
Quick check: Node version command.
Recap
Recap: Verified Node and npm, ran a .js file, learned a simple npm script, and used console tools in both Node and the browser.
Frequently asked questions
Is the “Setup: Node + npm, Running .js, DevTools Console” lesson free?
Yes — the full text of “Setup: Node + npm, Running .js, DevTools Console” is free to read here on the web, and the JavaScript Academy course includes 3 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the JavaScript Academy course, upgrade to CoddyKit PRO.
What will I learn in “Setup: Node + npm, Running .js, DevTools Console”?
Install Node, verify versions, run .js files, learn npm basics, and practice with the browser DevTools console. You practise JavaScript Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start JavaScript Academy?
No prior experience is required. JavaScript Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 2 of 3, so you can start here or from the beginning and move at your own pace.
How long does the “Setup: Node + npm, Running .js, DevTools Console” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this JavaScript Academy lesson?
Yes. Every JavaScript Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- What is JavaScript? Engines (V8/SpiderMonkey) & Runtimes (Browser vs Node)
- Setup: Node + npm, Running .js, DevTools Console
- First Program & I/O (console, alerts in browser)