Node app running error

nodejs

#1

I tried to lunch a simplest app, described here: Writing a Node.js App
The single file (server-cloud9.js) I try to lunch contains the following code:

var http = require('http');
http.createServer(function (req, res) {
    res.writeHead(200, {'Content-Type': 'text/plain'});
    res.end('Hello World\n');
}).listen(process.env.PORT, process.env.IP);

The command saved in the comfig is, accordingly: node server-cloud9.js
But after calling Run command I got following message:

Your code is running at https://js-world-srgg6701.c9users.io.
Important: use process.env.PORT as the port and process.env.IP as the host in your scripts!

module.js:327
throw err;
^

Error: Cannot find module '/home/ubuntu/workspace/node’
at Function.Module._resolveFilename (module.js:325:15)
at Function.Module._load (module.js:276:25)
at Function.Module.runMain (module.js:441:10)
at startup (node.js:139:18)
at node.js:968:3

Process exited with code: 1

Why?


#2

what about running the app in the terminal?

node your-file.js