Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

怎么后台运行或者开机自启动,每次都要输入一边好麻烦 #11

Open
yzj-again opened this issue Oct 7, 2017 · 4 comments

Comments

@yzj-again
Copy link

No description provided.

@ljhcage
Copy link

ljhcage commented Jan 12, 2018

把命令写成脚本,然后脚本设置成自启动就行

@chinanf-boy
Copy link

使用 pm2

npm i -g pm2

使用

pm2 start local.js -- .... # 运行
pm2 list # 查看
pm2 save  # 保存当前进程并输出保存文件路径
pm2 startup # 开机自启动 

使用windows 记住 pm2 是不支持开机启动的

官方建议: 有一些外部库可以生成Windows兼容的启动脚本,请检出pm2-windows-service或pm2-windows-startup。

使用-pm2-windows-startup-简单,易用,不知道怎么卸载

或者 pm2-windows-service 可卸载和配置- github 库 >>

@WeihuaGu
Copy link

linux 简单写个systemd的unit,然后enable下就完了.
linux好办,windows怎么整?

@whtiehack
Copy link

@WeihuaGu 你楼上的已经告诉你了呀。。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants