Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deploy nodejs in Windows environment

I am trying to deploy nodejs in a windows environment. As far as I can see nodejs is just a standard application run through the command-line. However running it that way is not very practical in a server environment. Is there a way to run it as a windows service, so you get all the benefits of controlling the execution as you have with other services? I found similar forum entries about this subject, however they are all related to running nodejs in a linux environment, how would you go about doing this in a window environment?

like image 900
aggaton Avatar asked Sep 16 '13 16:09

aggaton


People also ask

Can I use NVM on Windows?

Node Version Manager, more commonly called nvm, is the most popular way to install multiple versions of Node. js, but is only available for Mac/Linux and not supported on Windows.


1 Answers

Nodejs application is not like mongodb, redis, nginx ... It's not supposed to run as an os service.

As a best practice, people usually use a process management tool like pm2 to run production nodejs applications. You can give it a try by creating a deploy.sh or deploy.bat as an execution file which trigger pm2 command to start or restart the application.

like image 105
haotang Avatar answered Oct 20 '22 01:10

haotang