I tried to launch a simplest app, described here: https://community.c9.io/t/writing-a-node-js-app/1731 The single file (server-cloud9.js) I try to launch 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 config is, accordingly:
node server-cloud9.js
But after calling the 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?