bhylu.com

Advertisements

Node.js Installation

Save a complete lesson source as a local file and run it with Node. Check the actual interpreter rather than assuming every terminal selects the same installation.

How it works

The course is reviewed with the installed Node 22.15.1 runtime and the separate bundled Node 24.22.1 runtime. These are tested baselines, not a claim about the latest patch available. Use a supported patched release for your own deployment and rerun your tests after upgrades. Run node --version and npm --version in your terminal. Save this source as setup.mjs in an empty exercises folder, then run node setup.mjs. No Apache, PHP or MySQL service is needed for ordinary scripts.

Run the code

Run this example locally with Node.js. The exact sources are reviewed on Node 22.15.1 and Node 24.22.1 unless a specialised lab states otherwise. Save the complete source as setup.mjs in a separate empty exercises folder and run node setup.mjs. There is no Node.js browser runner on Bhylu; the plain JavaScript playground does not provide these filesystem, server or process APIs.

Download the complete source. Ordinary Node scripts need no Apache, PHP or MySQL service. File examples own their temporary folders; network fixtures use loopback and available temporary ports.

Example

setup.mjs

console.log('Runtime major:', Number(process.versions.node.split('.')[0]) >= 22);
console.log('Module URL:', import.meta.url.startsWith('file:'));
console.log('DOM available:', typeof document);

Expected result

Runtime major: true
Module URL: true
DOM available: undefined

The output checks the minimum major family, an ESM file URL and the absent browser document object. It does not assert that every Node 22 or later API behaves identically. Version-specific lessons state their additional requirements.

Use the Node.js API reference for the precise version contract.