Installing Node.js
Installing Node.js adds the node command to a computer. The node command runs JavaScript files.
The install check
This command asks for the installed Node.js version. Run it in a terminal.
node --versionA short message
This line prints a short message.
console.log("Node.js is installed");Example
console.log(process.version);
console.log("Node.js is installed");Key points
- Get Node.js from nodejs.org.
- nodejs.org is the home page for Node.js.
- The installer is a program that adds Node.js to a computer.
- Run the installer and follow its steps.
- A terminal runs commands typed at a prompt.
- Type node --version in a terminal to check the install.
In this example, the opening line prints the installed Node.js version. The version is v24.22.1. The second line prints Node.js is installed.
Note
The check prints v24.22.1 when this version is installed.
Try it Yourself
Edit the code, then press Run.
Running is simulated
Exercise
Which command checks the installed Node.js version?