I installed express.js in a specific tabulation table, I try to execute "npm start" in the CLI, then I got an error:
0 info it worked if it ends with ok
1 verbose cli [ 'node', '/opt/rh/nodejs010/root/usr/bin/npm', 'start' ]
2 info using npm@1.3.24
3 info using node@v0.10.25
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info prestart application-name@0.0.1
6 info start application-name@0.0.1
7 verbose unsafe-perm in lifecycle true
8 info application-name@0.0.1 Failed to exec start script
9 error application-name@0.0.1 start: `node app.js`
9 error Exit status 8
10 error Failed at the application-name@0.0.1 start script.
10 error This is most likely a problem with the application-name package,
10 error not with npm itself.
10 error Tell the author that this fails on your system:
10 error node app.js
10 error You can get their info via:
10 error npm owner ls application-name
10 error There is likely additional logging output above.
11 error System Linux 2.6.32-504.3.3.el6.x86_64
12 error command "node" "/opt/rh/nodejs010/root/usr/bin/npm" "start"
13 error cwd /var/lib/openshift/54d99b5f5973ca0a11000120/app-root/runtime/repo/Scoreboard/scoreboard
14 error node -v v0.10.25
15 error npm -v 1.3.24
16 error code ELIFECYCLE
17 verbose exit [ 1, true ]
The contents of app.js:
var express = require('express')
, routes = require('./routes')
, user = require('./routes/user')
, http = require('http')
, path = require('path');
var app = express();
app.set('port', process.env.OPENSHIFT_NODEJS_PORT || 8080);
app.set('ipaddr', process.env.OPENSHIFT_NODEJS_IP || "127.0.0.1");
app.set('views', __dirname + '/views');
app.set('view engine', 'jade');
app.use(express.favicon());
app.use(express.logger('dev'));
app.use(express.bodyParser());
app.use(express.methodOverride());
app.use(app.router);
app.use(express.static(path.join(__dirname, 'public')));
if ('development' == app.get('env')) {
app.use(express.errorHandler());
}
app.get('/', routes.index);
app.get('/users', user.list);
http.createServer(app).listen(app.get('port'), function(){
console.log('Express server listening on port ' + app.get('port'));
});
I had no idea how to fix this, I'm looking for a solution on how to run the express in Openshift, thanks!
source
share