Answer the question
In order to leave comments, you need to log in
JS does not start in daemon mode, although everything works fine in manual mode?
Subject. I have never worked with Node.JS, it took to raise a small service, and immediately the problem.
I'm trying to follow the instructions: https://www.digitalocean.com/community/tutorials/h...
I made a test "Hello, World". I put it in the /var/www/html/nodejs/server.js file . I run
the command node server.js
, the inscription appears in the console
Server running at 0.0.0.0:1200, IP_ADRESS:1200 opens "Hello World", i.e. everything works as it should.
sudo pm2 start server.js
I get the following
[PM2] Applying action restartProcessId on app [server](ids: 0)
[PM2] [server](0) ✓
[PM2] Process successfully started
┌─────┬───────────── ┬─────────────┬─────────────────────┬────────── ────┬───────┬──────────────────────────────────── ──────┬──────────┐
│ id │ name │ namespace │ version │ mode │ pid │ uptime │ ↺ │ status │ cpu │ mem │ user │ watching │
├──── ─┼───────────┼─────────────────────────────────────┼─── ────────┼────────┼───────┼───────────────────────┼─── ────────┼───────────┼────────────┤
│ 0 │ server │ default │ N/A │ fork │ 8303 │ 0s │ 15 │ online │ 0% │ 7.3mb │ root │ disabled │
└─────┴─────────────────────────────────────────┴──────── ──┴──────────┴────────┴────── ──┴───────────┴───────────┴─────────────────────────────────────
sudo pm2 list
┌─────┬───────────────────────────────────────────────── ──┬──────────┬─────────┬────── ──┬──────────┬──────────┬────────────┐
│ id │ name │ namespace │ version │ mode │ pid │ uptime │ ↺ │ status │ cpu │ mem │ user │ watching │
─────┼─────────┼────────────────────────────────────────── ────┼──────────┼─────────────────────────────────────┤
│ 0 │ server │ default │ N/A │ fork │ 0 │ 0 │ 30 │ errored │ 0% │ 0b │ root │ disabled │
└─────┴──────────┴── ───────────┴────────────────────────────────────────── ─┴──────┴────────────────────────────────────┴──────── ───┴───────────┘
Answer the question
In order to leave comments, you need to log in
Run it manually, then go to ip_adress:1200 and you will see with what error it fell. Or run pm2 log
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question