您好,我最近使用 redhat openshift,运行“rhc tail -a {application}”时出错。
我得到错误代码:
-
-
npm 错误!消息sh "-c" "node server.js"
失败 1
和我的代码:
var fs = require('fs');
var db_helper = require("./db_helper.js");
var ipaddr = process.env.OPENSHIFT_INTERNAL_IP;
var port = process.env.OPENSHIFT_INTERNAL_PORT || 8080;
var http = require('http');
http.createServer().listen(port, ipaddr, function(){
console.log('Server started on %s...', Date(Date.now()));
});
var io = require('socket.io').listen(http);
io.sockets.on('connection', function(client) {
console.log('Client connected');
client.on('status', function(data) {
console.log(data);
db_helper.get_status(data,function(data) {
io.sockets.emit('populate', data);
});
});
db_helper.get_statusadmin(function(data) {
io.sockets.emit('adminpopulate', data);
});
client.on('statusadmin', function (data) {
db_helper.get_statusadmin(function(data) {
io.sockets.emit('adminpopulate', data);
});
});
});
如何解决?