티스토리 뷰

To build a Node.js server using PM2 on Windows 10, you can follow these steps:

Install Node.js on your Windows 10 machine by downloading and running the installer from the official Node.js website.
Open a terminal or command prompt window and install PM2 globally by running the following command: npm install -g pm2


Navigate to your Node.js project directory in the terminal or command prompt.


Start your Node.js server using PM2 by running the following command: pm2 start app.js (replace "app.js" with the name of your main Node.js file).


Check the status of your Node.js server and monitor its logs using PM2 by running the following command: pm2 status and pm2 logs, respectively.


Stop or restart your Node.js server using PM2 by running the following commands: pm2 stop app.js and pm2 restart app.js, respectively.


Note that PM2 provides many other useful features for managing Node.js servers, such as automatic restarts, clustering, and load balancing. You can read more about these features in the PM2 documentation.

댓글