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

NPM as exec child process does not work #98

Open
mbravo1 opened this issue Feb 19, 2024 · 0 comments
Open

NPM as exec child process does not work #98

mbravo1 opened this issue Feb 19, 2024 · 0 comments

Comments

@mbravo1
Copy link

mbravo1 commented Feb 19, 2024

Hello.

I have an app in Nodejs that running with pm2 sends the error 'Access is denied'. How can I make PM2 run as administrator privileges. Or do they have a good execution practice?

Please support me, I have been struggling with this for several days and the only way to solve it was to not use PM2 and create a Windows Task Scheduler.
var child = require('child_process').exec('net start MYSERVICE', function (error, stdout, stderr) { if (error !== null){ console.log(error); } else{ console.log("No error"); } });

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

No branches or pull requests

1 participant