Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pm2 install on Windows (fix suggestion) #2223

Closed
cbernstein opened this issue Jun 15, 2016 · 17 comments
Closed

pm2 install on Windows (fix suggestion) #2223

cbernstein opened this issue Jun 15, 2016 · 17 comments
Assignees

Comments

@cbernstein
Copy link

As you know, module installation has been broken on Windows. Here's a simple fix:

In file Modularizer.js,

  • Add a require for 'os'
  • At 'ugly hack', change the shelljs.exe line to:
  var no_errs = os.platform()==='win32'? ' 2> nul:' : ' 2> /dev/null';
  shelljs.exec('npm install ' + module_name + ' --prefix ' + cst.PM2_ROOT_PATH + no_errs, function(code) {
@cbernstein
Copy link
Author

OK, looks like you already have this fixed in master as of yesterday but not yet in a release. Any idea when the next release will be?

@cookie-ag
Copy link

cookie-ag commented Jul 4, 2016

issue

I am facing the same issue, any fixes?

Where can i find Modularizer.js on win?

@Unitech
Copy link
Owner

Unitech commented Jul 4, 2016

@serganus pm2-monit module does not exists
Try $ pm2 install pm2-server-monit

Else you can try PM2 v2:

$ npm install Unitech/pm2#development -g
$ pm2 update
$ pm2 install pm2-server-monit

@cookie-ag
Copy link

cookie-ag commented Jul 4, 2016

@Unitech Tried but doesn't work

Check the output for pm2 install pm2-server-monit:
issue2

After dev ver 2.0.0-rc3 :
issue3

npm cache clean didn't worked for me

@Unitech
Copy link
Owner

Unitech commented Jul 4, 2016

NPM version? Node.js version? PM2 version?

Have you tried with the PM2 on the development branch?

@cookie-ag
Copy link

@Unitech Yes i tried the development branch.

issue5

@cookie-ag
Copy link

2.15.8

@Unitech
Copy link
Owner

Unitech commented Jul 4, 2016

Could you upgrade your npm?

$ npm install npm -g

@cookie-ag
Copy link

Upgraded to 3.10.3 but same error

issue

@vmarchaud
Copy link
Contributor

I got this error resolved by launching the npm install into a shell in Modularizer.js#L111 :

install_instance = spawn('npm', [
      'install', module_name, '--prefix', cst.PM2_ROOT_PATH, '--loglevel=error'
    ],{
      stdio : 'inherit',
      async : true,
      shell: true
    });

Maybe a windows specific behavior ?

@cookie-ag
Copy link

@vmarchaud What do you mean by launching the npm install into a shell in Modularizer.js#L111?

@Unitech
Copy link
Owner

Unitech commented Jul 6, 2016

Windows fix from @vmarchaud has been merge to development branch,

$ npm install Unitech/pm2#development -g
$ pm2 update
$ pm2 install pm2-server-monit

Waiting for feedbacks

@Unitech Unitech closed this as completed Jul 6, 2016
@cookie-ag
Copy link

screen shot 2016-07-06 at 7 46 03 pm

screen shot 2016-07-06 at 7 46 24 pm

screen shot 2016-07-06 at 7 46 39 pm

I tried to follow the steps and here is the output as screenshots. still not fixed :-(

@vmarchaud
Copy link
Contributor

vmarchaud commented Jul 6, 2016

@serganus Can you give us your npm/node/pm2/windows exact version ?
Its seems that you dont have the lastest dev version because we dont have any git dependency since this morning and your first error seems to say that we do.

@cookie-ag
Copy link

cookie-ag commented Jul 6, 2016

  • pm2 version is 2.0.0-rc3
  • npm version is 3.1.0
  • node version is 4.4.7
  • Windows 7

I did the following but still same error.

pm2 kill
npm remove pm2 -g
npm cache clean
npm install Unitech/pm2#development -g
pm2 update
pm2 install pm2-server-monit

@vmarchaud
Copy link
Contributor

vmarchaud commented Jul 6, 2016

@serganus Working on node v6.X.X. If you want you can update to use it correctly while i'm debuging with node v4.X.X

@vmarchaud vmarchaud self-assigned this Jul 6, 2016
@vmarchaud
Copy link
Contributor

@serganus Merged on development branch, tested and working on my workstation, its good for you ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants