pm2-installer icon indicating copy to clipboard operation
pm2-installer copied to clipboard

Can't run exec files or any commands

Open sanzhardanybayev opened this issue 3 years ago • 6 comments

Description When I start app via pm2, node.js exec command that runs exe file fails. When I open it without pm2, everything works fine.

sanzhardanybayev avatar Nov 03 '21 11:11 sanzhardanybayev

Basically you cannot run any exec commands. For example, when I try to open exec("start chrome") I get no errors, but still app won't start. If I run it without pm2, it will start.

sanzhardanybayev avatar Nov 03 '21 12:11 sanzhardanybayev

@sanzhardanybayev did you figure this out? I am having an issue from nodejs where I can not delete(unlink) a file using pm2 but works without using pm2.

iii-james avatar Feb 15 '22 18:02 iii-james

@iii-james Unfortunately I could not come around it. It's Window's security policy that doesn't let exec commands on behalf of someone else.

sanzhardanybayev avatar Mar 21 '22 12:03 sanzhardanybayev

@iii-james how about you? Did you solve it?

sanzhardanybayev avatar Mar 21 '22 12:03 sanzhardanybayev

@sanzhardanybayev I believe I had to change the PM2 service Log On to use an admin account. And for some reason I had to use the "DOMAIN\USERNAME" and not the "USERNAME@DOMAIN" format.

image

iii-james avatar Mar 21 '22 13:03 iii-james

Thank you @iii-james for your solution! I didn't think of that. I took a loss and forgot about it. Definitely gotta try this one.

sanzhardanybayev avatar Apr 29 '22 13:04 sanzhardanybayev