Here's what I did, straight out of http://docs.cloudfoundry.com/frameworks/nodejs/nodejs.html, making allowances for the outdated documentation:
$ vmc push vknodesample01
Instances> app.js
1: node
2: other
Framework> 1
1: node
2: node06
3: node08
4: other
Runtime> 1
1: 64M
2: 128M
3: 256M
4: 512M
5: 1G
6: 2G
Memory Limit> 1
Creating vknodesample01... OK
1: vknodesample01.cloudfoundry.com
2: none
URL> vknodesample01.cloudfoundry.com
Updating vknodesample01... OK
Create services for application?> n
Save configuration?> y
Saving to manifest.yml... OK
Uploading vknodesample01... OK
Using manifest file manifest.yml
Starting vknodesample01... OK
Checking vknodesample01... GAVE UP
Application failed to start.
$ cat app.js
$ cat app.js
var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello World\n');
}).listen(1337, '127.0.0.1');
console.log('Server running at http://example.com:1337/');
example.com is actually one twenty seven dot 0 dot 0 dot 1
I did not include a package.json file since the doc said you don't need it unless you have a server.js
I would take out the loopback address, so it looks like this ...
var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello World\n');
}).listen(1337);
When you deploy I would also pick 'node08' rather than the 'node' framework option.