PM2 is a popular tool used with Node.js. What is its main job?
Think about what helps keep your app alive and restarts it if it crashes.
PM2 is a process manager that runs Node.js apps continuously, restarts them on failure, and helps manage multiple apps.
Consider you have a Node.js app in app.js. What does the command pm2 start app.js do?
Think about how PM2 helps keep your app alive even if it crashes.
The command starts the app under PM2's control, so it runs in the background and restarts if it stops unexpectedly.
You started two apps with PM2: pm2 start app1.js and pm2 start app2.js. What will pm2 list show?
PM2 tracks all apps it manages and shows their status.
The pm2 list command shows all running apps managed by PM2 with details like status and IDs.
You ran pm2 restart app but got an error: 'process not found'. What is the likely cause?
Check the exact process names or IDs PM2 shows in pm2 list.
The error means PM2 cannot find a process named 'app'. You must use the exact name or ID shown by PM2.
Choose the correct JSON format for a PM2 ecosystem file that runs app1.js and app2.js with names app-one and app-two.
Remember JSON requires double quotes around keys and strings, and arrays use square brackets.
Option C is valid JSON with an array of app objects each having a name and script. Others have syntax errors or missing fields.