# Using pm2 on Windows

**URL:** https://discourse.nodered.org/t/using-pm2-on-windows/6810
**Category:** General
**Created:** [14 January 2019 22:14 UTC](https://discourse.nodered.org/t/using-pm2-on-windows/6810 "2019-01-14T22:14:48Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![dustinmichels](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dustinmichels/32/5193_2.png) [@dustinmichels](https://discourse.nodered.org/u/dustinmichels)
#### Post date: [14 January 2019 22:14 UTC](https://discourse.nodered.org/t/using-pm2-on-windows/6810/1 "2019-01-14T22:14:48Z")

</div>

I want to launch/manage node-red using pm2 on Windows 10.

I have closely followed the instruction on the [running](https://nodered.org/docs/getting-started/running) page and various [online tutorials](https://diyprojects.io/installing-using-node-red-macos-windows/). The process doesn't seem to stay running.

## Command #1

If I execute the command:

`pm2 start 'C:\Users\Dustin Michels\AppData\Roaming\npm\node-red' -- -v`

The process seems to immediately stop

```auto
[PM2] Spawning PM2 daemon with pm2_home=C:\Users\Dustin Michels\.pm2
[PM2] PM2 Successfully daemonized
[PM2] Starting C:\Users\Dustin Michels\AppData\Roaming\npm\node-red in fork_mode (1 instance)
[PM2] Done.
┌──────────┬────┬─────────┬──────┬───────┬─────────┬─────────┬────────┬─────┬────────┬────────────────┬──────────┐
│ App name │ id │ version │ mode │ pid │ status │ restart │ uptime │ cpu │ mem │ user │ watching │
├──────────┼────┼─────────┼──────┼───────┼─────────┼─────────┼────────┼─────┼────────┼────────────────┼──────────┤
│ node-red │ 0 │ N/A │ fork │ 22708 │ stopped │ 1 │ 0 │ 0% │ 0 B │ Dustin Michels │ disabled │
└──────────┴────┴─────────┴──────┴───────┴─────────┴─────────┴────────┴─────┴────────┴────────────────┴──────────┘

```

## Command #2

If I instead execute the command:  
`pm2 start 'C:\Users\Dustin Michels\AppData\Roaming\npm\node_modules\node-red\red.js' -- -v`

Things look more promising. It says "status: online."

```auto
[PM2] Spawning PM2 daemon with pm2_home=C:\Users\Dustin Michels\.pm2
[PM2] PM2 Successfully daemonized
[PM2] Starting C:\Users\Dustin Michels\AppData\Roaming\npm\node_modules\node-red\red.js in fork_mode (1 instance)
[PM2] Done.
┌──────────┬────┬─────────┬──────┬───────┬────────┬─────────┬────────┬─────┬───────────┬────────────────┬──────────┐
│ App name │ id │ version │ mode │ pid │ status │ restart │ uptime │ cpu │ mem │ user │ watching │
├──────────┼────┼─────────┼──────┼───────┼────────┼─────────┼────────┼─────┼───────────┼────────────────┼──────────┤
│ red │ 0 │ 0.19.5 │ fork │ 25916 │ online │ 0 │ 0s │ 0% │ 34.8 MB │ Dustin Michels │ disabled │
└──────────┴────┴─────────┴──────┴───────┴────────┴─────────┴────────┴─────┴───────────┴────────────────┴──────────┘

```

But it seems like the process still stops immediately after displaying this message.

If I type `pm2 ls` I see no processes, and `pm2 show red` returns "red doesn't exist."

---

<div class="post-metadata">

### Author: ![hugobox](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hugobox/32/2948_2.png) [@hugobox](https://discourse.nodered.org/u/hugobox)
#### Post date: [16 January 2019 04:10 UTC](https://discourse.nodered.org/t/using-pm2-on-windows/6810/2 "2019-01-16T04:10:48Z")

</div>

Try the command pm2 logs to see if there were any clue as to what failed.

---

<div class="post-metadata">

### Author: ![miobox](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/miobox/32/27075_2.png) [@miobox](https://discourse.nodered.org/u/miobox)
#### Post date: [7 May 2019 05:17 UTC](https://discourse.nodered.org/t/using-pm2-on-windows/6810/3 "2019-05-07T05:17:22Z")

</div>

Could you find a solution to this? I have had the same problem, follow the following thread.

> **[Auto startup Node-Red with PM2 on Windows](https://medium.com/@suthipongbubpago/auto-startup-node-red-with-pm2-on-windows-f050f0232d07)**
>
> PM2 เป็น Process Manager ใช้จัดการ Process ต่างๆ ใน Node.js
> Node-RED ทำงานเป็น Process หนึ่งใน Node.js
