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 4009940
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T08:56:20+00:00 2026-05-20T08:56:20+00:00

Node.js has no method ‘sendHeader’ Installation copy is from git clone git://github.com/joyent/node.git Is install

  • 0

Node.js has no method ‘sendHeader’

Installation copy is from git clone git://github.com/joyent/node.git

Is install inside ubunti lucid server as Amazon EC2 AMI file.

The simple say hello via command output is working.

But, when output to browser, it fail to works.

Guys, any idea to fix it?

I hope to use node.js, but seems it is not ready for production usage yet.

ubuntu@ip-10-129-31-63:~/Desktop/node/test3$ node hello_world_server.js
Server running at http://localhost:8080/

/home/ubuntu/Desktop/node/test3/hello_world_server.js:5
    response.sendHeader(200, {"Content-Type": "text/html"});
             ^
TypeError: Object #<ServerResponse> has no method 'sendHeader'
    at Server.<anonymous> (/home/ubuntu/Desktop/node/test3/hello_world_server.js:5:14)
    at Server.emit (events.js:45:17)
    at HTTPParser.onIncoming (http.js:1081:12)
    at HTTPParser.onHeadersComplete (http.js:87:31)
    at Socket.ondata (http.js:980:22)
    at Socket._onReadable (net.js:654:27)
    at IOWatcher.onReadable [as callback] (net.js:156:10)
ubuntu@ip-10-129-31-63:~/Desktop/node/test3$ node -v
v0.5.0-pre

Code to run

var sys = require('sys'),
   http = require('http');

http.createServer(function (req, res) {

  setTimeout(function () {

    res.writeHead(200, {'Content-Type': 'text/html'});

    res.write('<br/><strong>&nbsp;&nbsp;&nbsp;&nbsp;Hello World!</strong>');

    res.end();

  }, 2000);

}).listen(8000);

sys.puts('Server running at http://127.0.0.1:8000/');
  • 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-20T08:56:21+00:00Added an answer on May 20, 2026 at 8:56 am

    It’s “setHeader”, not “sendHeader”.

    And no, node is not ready for production use. That doesn’t stop a lot of people from using it, but even they’ll tell you that they’re a little crazy for doing so.

    edit — the other answers may be right, that it may be you’re looking for “writeHead()”. Since all I’m doing here is looking at the quite lovely node.js documentation at nodejs.org, I’m forced to wonder whether you’ve done that yet yourself.

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

Sidebar

Related Questions

I'm using the following node module because I would like to prevent XSS: https://github.com/chriso/node-validator
I'm trying to build a tree, where each node has six children. The method
I am trying to get from localNodes the Node who has the minimum distance
I had installed node by following article https://github.com/ry/node/wiki/Building-node.js-on-Cygwin-%28Windows%29 Now i had made a test.js
I have a tree structure where each Node has a parent and a Set<Node>
My senario in NS 2.29 has 5 nodes which each node has 2 interfaces
I'm trying to test if each specified parent node has one specified child node.
I have a table which contains data about which node has been visited. It
I'd like to be able to identify whether a given DOM node has been
To keep things simple, lets say I have a Node class, each node has

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.