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

  • SEARCH
  • Home
  • 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 8066557
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T12:03:01+00:00 2026-06-05T12:03:01+00:00

I am trying to learn node.js, but I’m having trouble getting the simple server

  • 0

I am trying to learn node.js, but I’m having trouble getting the simple server to run on localhost:8888.

Here is the code for server.js:

var http = require("http");

http.createServer(function(request, response) {
response.writeHead(200, {"Content-Type": "text/plain"});
response.write("Hello World");
response.end();
}).listen(8888);

server.js runs without errors, and trying netstat -an | grep 8888 from terminal returns

tcp4       0      0  *.8888                 *.*                    LISTEN

However, when I go to localhost:8888 in a browser, it says that it cannot be found.

I’ve looked at all the related questions, and nothing has worked so far. I’ve tried different ports, etc. I know that my router blocks incoming traffic on port 8888, but shouldn’t that not matter if I’m trying to access it locally? I’ve run tomcat servers on this port before, for example. Thanks so much for your help!

node.js version: v0.6.15
OS: Mac OS 10.6.8

  • 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-06-05T12:03:02+00:00Added an answer on June 5, 2026 at 12:03 pm

    This code works–I just tried it and navigated to localhost:8888 and saw the expected output.

    It’s possible that you have a firewall that’s too restrictive or you have a bad install of Node.js.

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

Sidebar

Related Questions

I'm trying to learn node.js. I made a http server: http.createServer(function(request, response) { response.writeHead(200,
I'm still trying to learn node.js + express.js to make something... But after many
I'm trying to learn Node and have the function: this.logMeIn = function(username,stream) { if
im trying to learn how to use javascript objects, and got some issue here.
Im trying to learn a bit about c++ and have run in to some
Trying to learn F# but got confused when trying to distinguish between fold and
I'm trying to learn RSpec and writing test for CRUD actions. Here is my
Trying to learn jquery here so I took a regular javascript snippet that loops
I am new to node.js and I'm just trying to learn how to use
trying to learn and practice arrays but I have a problem with this small

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.