{"id":16876,"library":"pm2-windows-startup","title":"PM2 Windows Startup Utility","description":"This package enables PM2 (Process Manager 2) to automatically resurrect its saved process list upon Windows operating system startup. It achieves this by adding a specific entry to the Windows Registry that triggers PM2 on boot, leveraging the `start-on-windows-boot` library for low-level registry manipulation. The current stable version is 1.0.3, indicating a mature and stable utility that is likely in maintenance mode rather than active feature development. Its primary differentiator is its focused solution for automating PM2 process continuity specifically within Windows environments, which is crucial for server stability and uptime after system reboots. It serves as a dedicated tool for system administrators and developers deploying Node.js applications with PM2 on Windows servers.","status":"maintenance","version":"1.0.3","language":"javascript","source_language":"en","source_url":"https://github.com/marklagendijk/node-pm2-windows-startup","tags":["javascript","pm2","windows","boot","start","startup"],"install":[{"cmd":"npm install pm2-windows-startup","lang":"bash","label":"npm"},{"cmd":"yarn add pm2-windows-startup","lang":"bash","label":"yarn"},{"cmd":"pnpm add pm2-windows-startup","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Handles the low-level Windows registry manipulation for creating the startup entry.","package":"start-on-windows-boot","optional":false}],"imports":[{"note":"This package is primarily a command-line utility installed globally. It does not expose a programmatic API for direct import and use within JavaScript/TypeScript code. Interaction is solely via the `pm2-startup` executable in the terminal.","wrong":"import pm2Startup from 'pm2-windows-startup'","symbol":"pm2-startup","correct":"pm2-startup install"}],"quickstart":{"code":"npm install pm2-windows-startup -g\npm i -g pm2 # Ensure PM2 is also installed globally if not already\npm i -g pm2-logrotate # Optional: for log management\n\n# Install the PM2 startup script into Windows Registry\npm2-startup install\n\n# Start your Node.js application(s) with PM2, e.g.\npm2 start app.js --name 'my-node-app'\n\n# Crucially, save the current PM2 process list so it can be resurrected on startup\npm2 save","lang":"bash","description":"Demonstrates global installation of the utility, then how to register PM2 for Windows startup, and finally how to save the current PM2 process list for resurrection."},"warnings":[{"fix":"Run your terminal (Command Prompt, PowerShell, Git Bash) as an Administrator before executing `pm2-startup install`.","message":"The `pm2-startup install` command requires Administrator privileges on Windows to modify the system registry. Running without elevated permissions will result in an 'Access is denied' or 'EPERM' error.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Always execute `pm2 save` immediately after making changes to your PM2 process list (e.g., starting new apps, deleting apps) to ensure those changes are reflected on the next system reboot.","message":"After installing the startup utility, you MUST run `pm2 save` to persist the current list of PM2 processes. If `pm2 save` is not executed, PM2 will start on boot but will not resurrect any applications.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Test thoroughly with your target Node.js version. If issues arise, consider alternatives or checking for forks that support newer Node.js runtimes, as the package itself hasn't seen recent updates.","message":"This package specifies Node.js engine compatibility `>=0.10`. While it might function on modern Node.js versions, compatibility issues could arise with very old or very new Node.js releases, especially concerning underlying dependencies or system APIs it interacts with.","severity":"breaking","affected_versions":"All versions, potential with Node.js >=16"}],"env_vars":null,"last_verified":"2026-04-22T00:00:00.000Z","next_check":"2026-07-21T00:00:00.000Z","problems":[{"fix":"Close your current terminal, then restart it by right-clicking and selecting 'Run as administrator'. Execute `pm2-startup install` again.","cause":"Attempting to modify the Windows Registry without sufficient permissions.","error":"Error: Access is denied."},{"fix":"Ensure the current user has write permissions to the `.pm2` directory (usually in the user's home folder). If this persists, try reinstalling PM2 and `pm2-windows-startup` globally.","cause":"PM2 cannot write its process dump file, often due to permissions or a corrupted installation.","error":"Error: EPERM: operation not permitted, open 'C:\\Users\\<YourUser>\\.pm2\\dump.pm2'"},{"fix":"First, ensure `pm2-startup install` completed successfully (run as Administrator). Then, make sure you've started your applications with PM2 and explicitly run `pm2 save` to persist the process list.","cause":"The `pm2 save` command was likely not executed after starting applications or `pm2-startup install` failed to register correctly.","error":"PM2 processes are not starting automatically after Windows reboot."}],"ecosystem":"npm","meta_description":null}