0

我在 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)

有人能帮我吗?

4

1 回答 1

0

要在 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
于 2016-06-28T09:11:09.890 回答