pm2 icon indicating copy to clipboard operation
pm2 copied to clipboard

Windows Support

Open babnik63 opened this issue 12 years ago • 39 comments

I think that pm2 does not support windows. Is it correct? Is there any plan for supporting windows?

babnik63 avatar Jul 21 '14 12:07 babnik63

It's not but it shouldn't be so hard to make it work now that there are no C bindings anymore.

If you could give it a try it would be great! I personnaly have no windows computer to test this :/

soyuka avatar Jul 21 '14 16:07 soyuka

To make PM2 compatible with Windows we have to change a lot of stuff about how PM2 handle paths.

I think opening a bountysource to crowdfund the Windows support. If people are interested please tell us a :+1:

Thanks

(related #6 #534 #362 )

Unitech avatar Jul 28 '14 10:07 Unitech

Like using path.join() everywhere (handle the windows paths just well ;))

soyuka avatar Jul 28 '14 12:07 soyuka

:+1:

sheymann avatar Aug 05 '14 08:08 sheymann

We just launched a crowd funding campaign on boutysource for the Windows support:

https://www.bountysource.com/teams/keymetricsio/fundraisers/600-pm2-windows-support

Hope we will get enough attention for this Windows feature !

Unitech avatar Aug 29 '14 10:08 Unitech

Hello,

You could have a try of the Windows support for PM2:

Try this:

C:/ $ npm install git://github.com/Unitech/pm2#development -g

Give us your feedback!

Unitech avatar Oct 16 '14 12:10 Unitech

It looks like it actually installs and is running the project which is great! Anytime I run a pm2 command on my windows 7 machine though I get the following TypeError exception:

image

dlbrown06 avatar Oct 17 '14 21:10 dlbrown06

I am new to PM2 and am experimenting with it on a Windows dev environment. I am on Windows 7 and do all my work from a GitBash prompt. I installed from the git #development url listed 2 posts above.

  1. During Install I got the following output - note the couple errors in it. PM2 generally seemed to work despite these messages:
$ npm install git://github.com/Unitech/pm2#development -g
npm WARN `git config --get remote.origin.url` returned wrong result (git://github.com/Unitech/pm2)
\
> [email protected] preinstall C:\Users\msamblanet\AppData\Roaming\npm\node_modules\pm2
> bash ./scripts/preinstall.sh

npm WARN optional dep failed, continuing [email protected]
C:\Users\msamblanet\AppData\Roaming\npm\pm2 -> C:\Users\msamblanet\AppData\Roaming\npm\node_modules\pm2\bin\pm2

> [email protected] postinstall C:\Users\msamblanet\AppData\Roaming\npm\node_modules\pm2
> bash ./scripts/postinstall.sh

./scripts/postinstall.sh: line 3: /c/Program: No such file or directory
[email protected] C:\Users\msamblanet\AppData\Roaming\npm\node_modules\pm2
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] ([email protected])
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected]
├── [email protected] ([email protected])
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected])
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected], [email protected])
├── [email protected] ([email protected])
└── [email protected]
  1. My app basically worked as I tried 3-4 different commands. However, the ilogs command just hangs at the "Waiting for pm2..." prompt.

I have not gotten very far but my app seems to run and be managed correctly. I will report back if I bump into more issues.

msamblanet avatar Oct 21 '14 18:10 msamblanet

@msamblanet ~~I don't see any pm2 errors there~~ :) About ilogs it is https://www.npmjs.org/package/blessed dependent and I don't think that windows is supported :/.

Thanks for the feedback!

soyuka avatar Oct 21 '14 18:10 soyuka

The one I was referring to in the log was:

[email protected] postinstall C:\Users\msamblanet\AppData\Roaming\npm\node_modules\pm2
> bash ./scripts/postinstall.sh

./scripts/postinstall.sh: line 3: /c/Program: No such file or directory

Given the reference to pm2 there I was assuming it was a PM2 post-install script...if not I'll need to look further and see what was causing that...

msamblanet avatar Oct 21 '14 18:10 msamblanet

At first glance the Windows support seems to be fine now, except that a command window (cmd.exe) keeps popping up constantly while at least one process is running or at the time when a process is being restarted by watch. The window disappears within a second or less, but it's still a little annoying for the user. Sorry, I can't pursue this issue now, but maybe someone has a clue why it's happening.

bdadam avatar Jan 02 '15 20:01 bdadam

I keep getting the same problem as #6, where the deamon launches without problems (and i'm able to monitor it on keymetrics.io), but apps don't start. there are no errors. the table of apps is just empty. Any ideas where to look?

HalfdanJ avatar Jan 21 '15 01:01 HalfdanJ

Try my branch or take this pull: https://github.com/Unitech/PM2/pull/982 https://github.com/echiu64/PM2/tree/development

Looking for more testing.. seems to work fine for my local dev work

echiu64 avatar Jan 31 '15 21:01 echiu64

This solves the problem with launching nodes, but pm2 logs doesn't work.

$ pm2 logs
######## Starting streaming logs for [all] process
events.js:72 
     throw er;
Error: spawn ENOENT

HalfdanJ avatar Feb 01 '15 12:02 HalfdanJ

Can you delete your pm2 home directory? On windows 7/vista it should be c:\users.pm2

Also, try running with DEBUG=* in your environment variables and send me the output

echiu64 avatar Feb 02 '15 02:02 echiu64

There remains some RPC issues connecting to the rpc.sock pipe... tracking it down when I can...

echiu64 avatar Feb 02 '15 04:02 echiu64

Not RPC issues, but killing Satan issues. Pull https://github.com/Unitech/PM2/pull/986 created since windows doesn't support SIGQUIT.

HalfdanJ, try my windoze branch https://github.com/echiu64/PM2/tree/windoze, it has some additional logging when running with DEBUG=* in your environment variable. Be sure to restart pm2 daemons (and kill them manually and pm2 kill doesn't work w/o my latest patches)

echiu64 avatar Feb 02 '15 05:02 echiu64

@echiu64 I still get the error running PM2 logs

  pm2:constants Windows detected +0ms
  pm2:satan [PING PM2] Trying to connect to server +80ms
  axon:sock connect attempt null://./pipe/rpc.sock +0ms
  axon:sock connect +3ms
  axon:sock add socket 0 +0ms
  axon:queue flush 0 messages +1ms
  axon:sock closing +0ms
  axon:sock closing 1 connections +0ms
  pm2:satan Daemon alive +7ms
  axon:sock remove socket 0 +1ms
  pm2:satan Launching RPC client on port \\.\pipe\rpc.sock undefined +1ms
  axon:sock connect attempt null://./pipe/rpc.sock +1ms
  axon:sock connect +0ms
  axon:sock add socket 0 +1ms
  axon:queue flush 0 messages +0ms
  pm2:satan Connected to Daemon +1ms
  pm2:cli Got message from Satan as succesfully connected to PM2, now parsing ar
guments +9ms
  pm2:satan Calling daemon method pm2:getVersion +0ms
  pm2:satan Calling daemon method pm2:getMonitorData +3ms
########### Starting streaming logs for [all] process

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: spawn ENOENT
    at errnoException (child_process.js:1011:11)
    at Process.ChildProcess._handle.onexit (child_process.js:802:34)

HalfdanJ avatar Feb 02 '15 08:02 HalfdanJ

Can you run using my latest branch? You should see more info like:

pm2:constants PM2_ROOT_PATH: C:\Users\echiu\.pm2 +0ms

Also, just do a pm2 info and then pm2 logs as a test case. If that works, do a "node pm2 start test\fixtures\echo.js" and then "pm2 logs"

Would be good to see the output of whatever process you spawn.

echiu64 avatar Feb 02 '15 15:02 echiu64

Sorry, had not checked out the correct branch... But same error still

C:\node\app-playground>pm2 logs
  pm2:constants PM2_ROOT_PATH: C:\Users\drexjojo\.pm2 +0ms
  pm2:constants Windows detected +5ms
  pm2:satan [PING PM2] Trying to connect to server +76ms
  axon:sock connect attempt null://./pipe/rpc.sock +0ms
  axon:sock connect +3ms
  axon:sock add socket 0 +0ms
  axon:queue flush 0 messages +1ms
  axon:sock closing +1ms
  axon:sock closing 1 connections +1ms
  pm2:satan Daemon alive +8ms
  axon:sock remove socket 0 +3ms
  pm2:satan Launching RPC client on port \\.\pipe\rpc.sock undefined +3ms
  axon:sock connect attempt null://./pipe/rpc.sock +1ms
  axon:sock connect +1ms
  axon:sock add socket 0 +0ms
  axon:queue flush 0 messages +1ms
  pm2:satan Connected to Daemon +4ms
  pm2:cli Got message from Satan as succesfully connected to PM2, now parsing ar
guments +5ms
  pm2:satan Calling daemon method pm2:getVersion +1ms
  pm2:satan Calling daemon method pm2:getMonitorData +3ms
########### Starting streaming logs for [all] process

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: spawn ENOENT
    at errnoException (child_process.js:1011:11)
    at Process.ChildProcess._handle.onexit (child_process.js:802:34)

HalfdanJ avatar Feb 02 '15 15:02 HalfdanJ