简体   繁体   English

如何运行节点而不会陷入节点命令提示符

[英]how to run node without getting stuck in the node command prompt

I've installed node on my ubuntu virtual private server and I SSH into it. 我已在ubuntu虚拟专用服务器上安装了节点,并通过SSH对其进行了SSH。 I run 我跑

$nodejs index.js

but after running the file, I'm now stuck in the node command prompt and I can only get out by pressing ctrl-C. 但是运行文件后,我现在停留在节点命令提示符下,只能按ctrl-C退出。 But doing that stops my nodejs server. 但是这样做会停止我的nodejs服务器。 I want to run my server and then go back to the shell and do other things. 我想运行我的服务器,然后返回外壳并执行其他操作。 How do I do this? 我该怎么做呢?

Use PM2. 使用PM2。 It is a process manager. 它是一个流程经理。 You can do whatever after initiate this on the server. 在服务器上启动此操作后,您可以执行任何操作。 https://github.com/Unitech/pm2 https://github.com/Unitech/pm2

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM