如何运行npm服务永远使用?

问题描述 投票:1回答:1

我的最终目标是使用Shipit自动化我的开发。我可以正确地删除服务器上的代码,但我无法正常执行命令NODE_ENV=production forever start -c 'npm run serve'。当我尝试在我的服务器上本地运行它时,这是我得到的响应(帮助输出)。我需要运行npm serve,因为它运行以下:"serve": "gulp build && npm-run-all --parallel gulp-watch jekyll-serve"。我的项目是Tabler的一个分支。

root@server:/var/www/server# cd /var/www/server/current/front-end/ && NODE_ENV=production forever start -c 'npm run serve'
help:    usage: forever [action] [options] SCRIPT [script-options]
help:    
help:    Monitors the script specified in the current process or as a daemon
help:    
help:    actions:
...
...
node.js forever shipitjs
1个回答
0
投票

如果永远不起作用,您可以使用另一个选项,以保持您的脚本文件始终在后台运行,您可以使用

PM2高于海平面

参考这个https://www.npmjs.com/package/pm2

或者第二个选项是你可以使用

TMUX

您可以使用它,它允许您运行npm服务,就像您在本地系统上运行一样,为您提供以下链接

https://www.digitalocean.com/community/tutorials/how-to-install-and-use-tmux-on-ubuntu-12-10--2

© www.soinside.com 2019 - 2024. All rights reserved.