S
S
Svyatoslav Khusamov2017-04-23 16:22:29
Windows
Svyatoslav Khusamov, 2017-04-23 16:22:29

How to create a service in NodeJS?

I am creating a service using https://support.microsoft.com/en-us/help/251192/ho...
The creation line is something like this

Sc create Element2 binPath="C:\Program Files\nodejs\node C:\Program Files\Element2\index.js --config C:\ProgramData\Element2\config.js" DisplayName="Element 2" start=auto

The service is created, but when it starts, an error pops up: Error 1053 The service did not respond to the request in a timely manner.
What could be the problem?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Ivan, 2017-04-23
@LiguidCool

You are creating a service from a program that is not a service. Naturally, it won't work.
First google link: stackoverflow.com/questions/10547974/how-to-install...

D
Dmitry Makarov, 2017-12-29
@MDiMaI666

use pm2 daemon
command
example
pm2 start app.js --name myservice

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question