greenteaone
windows下打开命令窗口,安装pm2:npm install pm2 -g
pm2成功安装,在项目目录下用pm2启动服务:pm2 start index.js,结果启动失败,错误如下:

.pm2\pm2.log last 15 lines:
PM2 | 2018-11-13T12:57:17: PM2 log: App [index:0] exited with code [1] via signal [SIGINT]
\index.js had too many unstable restarts (16). Stopped. "errored"

 
Error: EBADF: bad file descriptor, uv_pipe_open
at Object.exports._forkChild (child_process.js:110:5)
at Object.setupChannel (internal/process.js:247:8)
at startup (bootstrap_node.js:63:16)
at bootstrap_node.js:608:3
child_process.js:110
p.open(fd);
^
Error: EBADF: bad file descriptor, uv_pipe_open
at Object.exports._forkChild (child_process.js:110:5)
at Object.setupChannel (internal/process.js:247:8)
at startup (bootstrap_node.js:63:16)
at bootstrap_node.js:608:3
 
 
解决方案:
windows下用pm2启动node的时候,用cluster_mode启动,就可以成功启动node服务了。
命令如下:pm2 start index.js -i 0 -f    以cluster模式启动 node服务

相关文章:

  • 2021-12-17
  • 2021-07-05
  • 2021-06-02
  • 2022-12-23
  • 2022-12-23
  • 2021-04-19
  • 2021-12-30
  • 2021-08-17
猜你喜欢
  • 2022-02-25
  • 2021-07-23
  • 1970-01-01
  • 2022-02-06
  • 2022-12-23
  • 2021-08-01
  • 2021-11-08
相关资源
相似解决方案