Pm2 unable to access SSL cert and Key files even though I have permission to access those files

Viewed 24

When I deployed my mern app on our server it throwed me a EAccess error saying unable to access my cert and key files of ssl however then I created a group for me and my root with adequate permissions so that my node server can access those files and it did worked when im running it saying either node server.js or npm start however when I do the same with pm2 start server.js its unable to access those files,Can someone help what should I do so that pm2 can access my ssl files.

1 Answers
if(cluster.isMaster) {
console.log('Master has been started');
cluster.fork();
cluster.fork();} else {
console.log(`Worker process started ${process.pid}`)}

Use this code. Most of the time pm2 problem.

Related