Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 SSH 中,如果我运行:
$ node server
在我关闭 SSH 会话之前,我的 Web 应用程序运行良好。需要什么命令或配置才能在没有活动 SSH 会话的情况下一直运行?
你可以像这样运行它:
nohup node server
或者您可以永久安装。
npm -g install forever forever start server
如果你有多个 nodejs,你可以使用pm2它们来管理它们。
pm2
或者,使用 screen 或 tmux 在分离会话时保持 nodejs 运行。