{"id":2001,"date":"2022-08-30T15:21:13","date_gmt":"2022-08-30T15:21:13","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2013\/12\/08\/node-js-hello-world-script-not-working-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:21:13","modified_gmt":"2022-08-30T15:21:13","slug":"node-js-hello-world-script-not-working-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/node-js-hello-world-script-not-working-collection-of-common-programming-errors\/","title":{"rendered":"Node.js Hello world script not working-Collection of common programming errors"},"content":{"rendered":"<p>I just grabbed that code from an online tutorial:<\/p>\n<pre><code>var http = require('http');\nhttp.createServer(function (req, res) {\n  res.writeHead(200, {'Content-Type': 'text\/plain'});\n  res.end('Hello World\\n');\n}).listen(3000, 'my.ip.is.here');\nconsole.log('Server running at http:\/\/my.ip.is.here:3000\/');\n<\/code><\/pre>\n<p>When i start:<\/p>\n<pre><code>node app.js\n<\/code><\/pre>\n<p>I get the following error:<\/p>\n<blockquote>\n<p>events.js:48 throw arguments1; \/\/ Unhandled &#8216;error&#8217; event ^ Error: accept ENOSYS at errnoException (net.js:614:11) at TCP.onconnection (net.js:788:24)<\/p>\n<\/blockquote>\n<p>I am on a ubuntu 11.10 server VPS, i have nginx as web server but it s not started.<\/p>\n<p>Am i doing something wrong ?<\/p>\n<p id=\"rop\"><small>Originally posted 2013-12-08 05:41:10. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>I just grabbed that code from an online tutorial: var http = require(&#8216;http&#8217;); http.createServer(function (req, res) { res.writeHead(200, {&#8216;Content-Type&#8217;: &#8216;text\/plain&#8217;}); res.end(&#8216;Hello World\\n&#8217;); }).listen(3000, &#8216;my.ip.is.here&#8217;); console.log(&#8216;Server running at http:\/\/my.ip.is.here:3000\/&#8217;); When i start: node app.js I get the following error: events.js:48 throw arguments1; \/\/ Unhandled &#8216;error&#8217; event ^ Error: accept ENOSYS at errnoException (net.js:614:11) at TCP.onconnection (net.js:788:24) [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-2001","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/2001","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=2001"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/2001\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=2001"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=2001"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=2001"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}