Can't run downloaded project after moving from Cloud9


#1

I’m not positive if this fits here, but I’m looking for any help I can get.

I just compiled my Node.JS app from Cloud 9, and installed it on my server. When I run the .js file with node app.js I receive this exception:

throw new RangeError(’“port” argument must be >= 0 and < 65536’);
^

RangeError: “port” argument must be >= 0 and < 65536
at assertPort (internal/net.js:17:11)
at Server.listen (net.js:1389:5)
at EventEmitter.listen (/var/www/html/workspace/MRC/node_modules/express/lib/application.js:617:24)
at Object. (/var/www/html/workspace/MRC/app.js:81:5)
at Module._compile (module.js:570:32)
at Object.Module._extensions…js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.runMain (module.js:604:10)
at run (bootstrap_node.js:390:7)
at startup (bootstrap_node.js:150:9)
at bootstrap_node.js:505:3

This error wasn’t occurring while I was on Cloud9, but it is now. Could this be a problem with the actual app or my environment?

Any ideas? Thanks.


#2

sounds like you are using env.PORT which is not defined in your new environment.