Create a file app.js and add the following code:
app.js
console.log("Hello, Node.js!");
Run the script using:
node app.js
You can also execute JavaScript directly in the Node.js interactive shell:
node > console.log("Hello, Node.js!");