yogeshtakeo / BFS63

This is the official repositary for BFS 63
0 stars 0 forks source link

Task 2: Running Javascript File #2

Open yogeshtakeo opened 5 hours ago

yogeshtakeo commented 5 hours ago

Here’s a task for running a JavaScript file through Node.js:

Task: Running a JavaScript file using Node.js

Objective:

Learn how to run a JavaScript file using Node.js from the terminal/command line.

Prerequisites:

Steps:

  1. Verify Node.js Installation:

    • Open a terminal (or command prompt on Windows).
    • Run the following command to ensure Node.js is installed:
      node -v
    • This should output the Node.js version installed on your system.
  2. Create a JavaScript File:

    • Open your code editor and create a new file (e.g., app.js).
    • Add the following example code:
      console.log("Hello, Node.js is running!");
  3. Navigate to the File's Directory:

    • In the terminal, navigate to the directory where your app.js file is located using the cd command:
      cd path/to/your/file
  4. Run the JavaScript File:

    • Execute the JavaScript file using Node.js by typing the following command:
      node app.js
    • You should see the output:
      Hello, Node.js is running!

Deliverables:

Oshinacharya1 commented 5 hours ago

js