E
E
Egor Sh2016-03-13 16:17:11
Nginx
Egor Sh, 2016-03-13 16:17:11

How to run npm start for angular2 with light-server so that it doesn't get disconnected when terminal is closed?

I installed a test Angular2 application on the server from the documentation - tour of heroes, and in order to run it you need to enter npm start, which starts the typescript compiler, and light-server. That's when I close the terminal or the ssh connection breaks, this server process crashes and the page is no longer available. How can I run npm start so that it doesn't close when I exit the terminal?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
C
codercat, 2016-03-13
. @EgorkZe

You need to run it as a daemon. A popular solution for this is forever.
Read more here:
stackoverflow.com/questions/4903570/how-does-one-s...

W
Wernalur, 2016-03-13
@Wernalur

How can I run npm start so that it doesn't close when I exit the terminal?

Wouldn't help.ubuntu.ru/wiki/screen work ? Although the variant with the demon is more correct. But if we simplify the question to this quote, then screen can handle it.

N
Nicholas, 2016-03-13
@ACCNCC

https://www.npmjs.com/package/pm2

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question