Node.js runs JavaScript outside the browser. Install a supported LTS release and use npm to manage dependencies inside each project.
What you need
- Node.js LTS from nodejs.org
- A code editor
- A terminal
Set up your environment
- Install Node.js using an official download method appropriate for your operating system. Reopen the terminal.
- Run
node --versionandnpm --version. Create a folder namednode-practice. - In that folder run
npm init -yto create package.json, then save the example as app.js. - Run the file in the terminal. This console example does not require a web server or an npm package.
Your first check
Save as app.js
const greeting = 'Hello from w1coding.com';
console.log(greeting);Run or verify
node app.jsExpected result: The terminal prints Hello from w1coding.com.
Common setup problems
- If node is not recognised, reopen the terminal after installation and check PATH.
- Browser APIs such as document are not available in a basic Node.js console program. Keep project dependencies local rather than installing everything globally.
Official documentation
Guide reviewed 17 November 2026. Check the linked vendor documentation for current supported versions and operating systems.