Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6163587
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T21:51:02+00:00 2026-05-23T21:51:02+00:00

I am trying to run a hello world program written in javascript in a

  • 0

I am trying to run a hello world program written in javascript in a separate file named hello.js

Currently running windows version of node.js.

The code runs perfectly in console window but how do I reference the path in windows environment.

C:\abc\zyx\hello.js

in Unix I guess it is showing $ node hello.js

I’m absolutely new to Node.js Please correct me if I am doing something wrong.

I tried

> node C:\abc\zyx\hello.js —-didn’t work

> C:\abc\zyx\hello.js –didn’t work

UPDATE1:

Added node.exe to the folder where hello.js file is sitting.
Added path point to the folder c:\abc\zyx\ and I get an error that says

ReferenceError: hello is not defined

see contents of hello.js

setTimeout(function() {
console.log('World!');
}, 2000);
console.log('Hello');

UPDATE 2:

So far I have tried all these version and none of them seems to work. May be I am doing something completely wrong.

>node hello.js
>$ node hello.js
>node.exe hello.js
>node /hello.js
>node \hello.js
> \node \hello.js
> /node /hello.js
> C:\abc\xyz\node.exe C:\abc\xyz\hello.js
> C:\abc\xyz\node.exe C:/abc/xyz/hello.js
> hello.js
> /hello.js
> \hello.js
>node hello

Refer to my file structure

.
├── hello.js
├── node.exe
└── paths.txt

RESOLVED:
Instead of running node.exe, try running in command prompt with the following option and it worked.

c:\>node c:\abc\hello.js
Hello
World! (after 2 secs)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T21:51:04+00:00Added an answer on May 23, 2026 at 9:51 pm

    Here are the exact steps I just took to run the “Hello World” example found at http://nodejs.org/. This is a quick and dirty example. For a permanent installation you’d want to store the executable in a more reasonable place than the root directory and update your PATH to include its location.

    1. Download the Windows executable here: http://nodejs.org/#download
    2. Copy the file to C:\
    3. Create C:\hello.js
    4. Paste in the following content:
        var http = require('http');
        http.createServer(function (req, res) {
          res.writeHead(200, {'Content-Type': 'text/plain'});
          res.end('Hello World\n');
        }).listen(1337, "127.0.0.1");
        console.log('Server running at http://127.0.0.1:1337/');
    
    1. Save the file
    2. Start -> Run… -> cmd
    3. c:
    4. C:>node hello.js

      Server running at http://127.0.0.1:1337/
      

    That’s it. This was done on Windows XP.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I'm trying to run my first hello world prog written in C. I
So I am trying to run console 64 bit Hello World program. I have
Trying to run a simple Hello World C++ program on Eclipse (Galileo) CDT plugin
I am trying to compile this Hello World program in Windows 7 with Visual
I am trying to run a simple program hello world in my android mobile.
I'm trying to run through the Hello World tutorial for the iPhone and i
I am trying run a program from a qmake .pro file which modifies the
I am trying to create my hello world windows app in WPF. What should
I am trying to build an application (Hello World) in Oracle JDeveloper and run.
I'm trying to debug the simple Hello World program that ships with Eclipse CDT.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.