Can not run my nodejs project Helloworld on Centos 7

I installed NodeJS by following link: But when I test my nodejs project HelloWorld, the system show errors: File hello.js: var http = require(‘http’); http.createServer(function (req, res) { res.writeHead(200, {‘Content-Type’: ‘text/plain’}); res.end(‘Hello World\n’); }).listen(8080,‘’); console.log(‘Server running at’); System show error: Server running at events.js:174 throw er; // Unhandled ‘error’ event ^ Error: getaddrinfo ENOTFOUND at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:56:26) Emitted ‘error’ event at: at GetAddrInfoReqWrap.doListen [as callback] (net.js:1448:12) at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:56:17) How can I fix this? Thanks


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.


Thanks for posting the question here so that others can learn from it as well. I believe the problem is with this line:


I believe it should instead read:


Just removing the protocol and putting the address only there.