【问题标题】:JSReport error "This socket is closed" occurs when run in background RHEL后台运行 RHEL 时出现 JSReport 错误“此套接字已关闭”
【发布时间】:2016-10-29 23:44:33
【问题描述】:

我在 JSReport www.jsreport.net 中有一个问题。

如果我在后台启动 npm start --production ,它可以工作,但如果我退出这个会话,则会出现错误:

Error occured - This socket is closed.
Stak - Error: This socket is closed.
    at WriteStream.Socket._write (net.js:638:19)
    at doWrite (_stream_writable.js:226:10)
    at writeOrBuffer (_stream_writable.js:216:5)
    at WriteStream.Writable.write (_stream_writable.js:183:11)
    at WriteStream.Socket.write (net.js:616:40)

有人可以帮我吗?

【问题讨论】:

    标签: javascript node.js socket.io npm jsreport


    【解决方案1】:

    要在linux后台启动jsreport,我使用

    nohup npm start --production > /dev/null 2>&1 &
    

    在后台启动 jsreport 并在重启时自动启动

    # install pm2
    sudo npm install pm2 -g
    
    # start pm2 daemon running jsreport
    sudo pm2 start npm -- start --production
    
    # create startup script for running jsreport after boot
    sudo pm2 startup
    sudo pm2 save
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-06-19
      • 2012-03-31
      • 2021-02-13
      • 2014-08-28
      • 2020-10-02
      • 2018-05-20
      相关资源
      最近更新 更多