Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to start an app with PM2.
Node.js
pm2 [1] app.js Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'run' or 'launch' instead of 'start' causes errors.
✗ Incorrect
Use start to launch an app with PM2.
2fill in blank
mediumComplete the code to list all running PM2 processes.
Node.js
pm2 [1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'show' or 'info' instead of 'list' does not display all processes.
✗ Incorrect
The list command shows all running PM2 processes.
3fill in blank
hardFix the error in the command to restart a process by name.
Node.js
pm2 [1] myApp Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'reload' or 'reset' instead of 'restart' causes unexpected behavior.
✗ Incorrect
Use restart to restart a process by name in PM2.
4fill in blank
hardFill both blanks to stop and delete a PM2 process by id.
Node.js
pm2 [1] [2] && pm2 delete [2]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'restart' instead of 'stop' or wrong process id causes failure.
✗ Incorrect
Use stop and the process id (e.g., 2) to stop and delete a process.
5fill in blank
hardFill all three blanks to save the current PM2 process list and setup startup script.
Node.js
pm2 [1] && pm2 [2] && pm2 [3]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing command order or using wrong commands causes startup issues.
✗ Incorrect
Use save to save the current process list, startup to generate startup script, and save again to populate the startup script with saved processes.