0

We have two instances of our Node-Express app: one for development, and one for production. We are implementing PM2 process manager. This is for a Windows Server 2012 environment.

For some baffling reason, PM2 (with pm2-windows-service) worked fine when set up in our dev environment, but won't even run node in our Prod environment. What could be the cause?

  • Log files reveal nothing helpful
  • If you look at my related question, you can see that PM2 appears to be launching node, but is not (or it instantly crashes).
  • All we can conclude is there is some difference in settings between these two servers. Any clue what difference in settings might be causing PM2 to fail like this?

This is related to a more specific question I have out there about issues we're having implementing PM2.

Thank you!

208_man
  • 1,440
  • 3
  • 28
  • 59

2 Answers2

1

Ok, I got the answer after posting an issue to the pm2 github issues page.

Sharing it here in case anyone else finds themselves in this situation:

https://github.com/Unitech/pm2/issues/4113

(basically pm2 3.2.5 introduced a bug that causes this issue in Windows. My QA install was 3.2.4. The issue was resolved by reverting to 3.2.4. Simple process, see instructions at link above.)

208_man
  • 1,440
  • 3
  • 28
  • 59
0

It may be not really pm2 issue, bit more npm. On the server where pm2 doesn't work please try that command in PowerShell:

Get-Command pm2

Does it return the correct version(not 0.0.0)? If not, there is an issue diring installing that package, so as an option it's possible to install that manually. Also we asked familiar question in that ticket last month:

https://github.com/Unitech/pm2/issues/3964

Like it described in a ticket above you can try to check other npm package with familiar issues:

npm install mocha -g

And that try to reach mocha-cli

Eugene Rotar
  • 83
  • 1
  • 2
  • 9
  • Hi @Eugenio R, Thank you so much for your answer. I tried the PowerShell command. It returned the command type (application), Name (pm2.cmd), and ModuleName (-blank-). No mention of version. Not sure what this means? Also, I followed the advice from the ticket on github, no problem installing other npm package (depcheck) and running it successfully. – 208_man Jan 10 '19 at 22:07
  • OK, I see. Well, looks like the pm2 really works weird on Windows IS(never heard about issues on linux). Maybe it makes sense to create the ticket directly on github for pm2(https://github.com/Unitech/pm2/issues), so they will be able to help faster – Eugene Rotar Jan 11 '19 at 14:33
  • Thanks @Eugenio R. I submitted a request. – 208_man Jan 11 '19 at 20:52
  • Your suggestion was a good one. After posting issue on github I learned the source of the problem. The recently-introduced PM2 v 3.2.5 introduces a bug which causes PM2 to crash in Windows. The solution was to revert to 3.2.4. Issue open on github: https://github.com/Unitech/pm2/issues/4113 Thank you for your input! to @Eugenio R – 208_man Jan 14 '19 at 16:46