I have the following code
var express = require('express')
, app = express()
, server = require('http').createServer(app)
, io = require('socket.io').listen(server)
, connect = require('connect')
, pg = require('pg')
, Client = pg.Client;
// Setup express middleware
app.use(express.static('public'));
app.use(connect.logger());
// Start the server
var port = process.env.OPENSHIFT_INTERNAL_PORT || 8080
, ip = process.env.OPENSHIFT_INTERNAL_IP || "127.0.0.1";
server.listen(port, ip);
But when the app start automaticaly or I start it manually with node I always receive the error: "warn: error raised: Error: listen EACCES"
The contents of package.json:
{
"name" : "test-app",
"version" : "0.0.1-1-alpha",
"description" : "test-app",
"dependencies": {
"express" : "3.1.x",
"connect" : "*",
"socket.io" : "0.9.x",
"i18next" : "1.6.x",
"bower" : "1.1.1",
"pg" : "*"
},
"engines": {
"node" : ">=0.10",
"npm" : "1.3.x"
},
"scripts": {
"start" : "node app"
}
}
What can I do to solve the problem? The sample server.js from openshift does not have this problem but it uses express 2.x.
Looks like you're using old environment variables. Try:
// Start the server.
var port = process.env.OPENSHIFT_NODEJS_PORT || 8080
, ip = process.env.OPENSHIFT_NODEJS_IP || "127.0.0.1";
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With