我正在尝试在Ubuntu上安装完整的javascript中的wep应用程序。在Windows上使用完全相同的代码没有任何错误,但是当我npm
运行构建并且pm2启动index.js
,并且执行pm2日志时,我有这样的错误:
带有[0]和pid [3511]的App [index],通过代码[0]退出 信号[SIGINT] PM2 |以-fork模式启动执行顺序 - 对于app name:index id:0 PM2 |应用名称:索引ID:0在线 0 |索引|你已经触发了一个未处理的拒绝,你可能忘记了接受Promise拒绝: 0 |索引| TypeError:“listener”参数必须是一个函数 0 |索引|在Socket.once(events.js:307:11) 0 |索引|在Socket.connect(net.js:943:10) 0 |索引|在Socket.connect(/usr/lib/node_modules/pm2/node_modules/async-listener/index.js:76:27) 0 |索引|在Connection.connect(/ media / armays / LaCie / DIane编组返回/ node_modules / pg / lib / connection.js:66:17) 0 |索引|在Client.connect(/ media / armays / LaCie / DIane编组返回/ node_modules / pg / lib / client.js:56:9) 0 |索引| at / media / armays / LaCie / DIane back back / server / helpers /....../ server / helpers / PGquery.js:31:12 0 |索引|在Promise._execute(/ media / armays / LaCie / DIane组建 背面/ node_modules /蓝鸟/ JS /释放/ debuggability.js:300:9) 0 |索引|在Promise._resolveFromExecutor(/ media / armays / LaCie / DIane形成 背面/ node_modules /蓝鸟/ JS /释放/ promise.js:483:18) 0 |索引|在新的Promise(/ media / armays / LaCie / DIane编组返回/ node_modules / bluebird / js / release / promise.js:79:10) 0 |索引|在pgQuery(/ media / armays / LaCie / DIane编组返回/ server / helpers /....../ server / helpers / PGquery.js:28:10) 0 |索引|在Object.getTable(/ media / armays / LaCie / DIane形成 背面/配置/ redis的/....../配置/ redis的/ redis.model.js:56:10) 0 |索引|在Object.init(/ media / armays / LaCie / DIane组建 背面/服务器/助洗剂/....../服务器/助洗剂/ routeBuilder.js:9:14) 0 |索引|在对象。 (/ media / armays / LaCie / DIane back back / server /..../ server / index.js:44:14) 0 |索引|在Module._compile(module.js:571:32) 0 |索引| at Object.Module._extensions..js(module.js:580:10) 0 |索引|在Module.load(module.js:488:32) 0 |索引|在tryModuleLoad(module.js:447:12) 0 |索引|在Function.Module._load(module.js:439:3) 0 |索引|在对象。 (/usr/lib/node_modules/pm2/lib/ProcessContainerFork.js:53:21) 0 |索引|在Module._compile(module.js:571:32) 0 |索引| at Object.Module._extensions..js(module.js:580:10) 0 |索引|在Module.load(module.js:488:32)
如何解决此问题并且Windows上不存在错误?我使用节点7。 我降级到节点7.7.1,但现在pm2在我pm2日志时重新启动应用程序:/
[STREAMING] Now streaming realtime logs for [all] processes
PM2 | App [index] with id [0] and pid [7475], exited with code [0] via signal [SIGINT]
PM2 | Starting execution sequence in -fork mode- for app name:index id:0
PM2 | App name:index id:0 online
PM2 | App [index] with id [0] and pid [7511], exited with code [0] via signal [SIGINT]
PM2 | Starting execution sequence in -fork mode- for app name:index id:0
PM2 | App name:index id:0 online