Registry / devops / pm2-windows-startup

pm2-windows-startup

JSON →
library1.0.3jsnpmunverified

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.

npm install pm2-windows-startup
INSTALL
IMPORT
SIG · PM2-WINDOWS-STARTU
P
pm2-windows-startup
devopsjavascriptv1.0.3
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

pm2-startup
pm2-startup install
import pm2Startup from 'pm2-windows-startup'
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.

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.

npm install pm2-windows-startup -g pm i -g pm2 # Ensure PM2 is also installed globally if not already pm i -g pm2-logrotate # Optional: for log management # Install the PM2 startup script into Windows Registry pm2-startup install # Start your Node.js application(s) with PM2, e.g. pm2 start app.js --name 'my-node-app' # Crucially, save the current PM2 process list so it can be resurrected on startup pm2 save
Debug
Known issues
gotchaThe `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.
fix
Run your terminal (Command Prompt, PowerShell, Git Bash) as an Administrator before executing `pm2-startup install`.
affects: >=1.0.0
gotchaAfter 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.
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.
affects: >=1.0.0
breakingThis 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.
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.
affects: All versions, potential with Node.js >=16
Errors
Common errors & fixes
Error: Access is denied.
Attempting to modify the Windows Registry without sufficient permissions.
fix
Close your current terminal, then restart it by right-clicking and selecting 'Run as administrator'. Execute `pm2-startup install` again.
Error: EPERM: operation not permitted, open 'C:\Users\<YourUser>\.pm2\dump.pm2'
PM2 cannot write its process dump file, often due to permissions or a corrupted installation.
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.
PM2 processes are not starting automatically after Windows reboot.
The `pm2 save` command was likely not executed after starting applications or `pm2-startup install` failed to register correctly.
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.
Upgrade
Version history
1.0.3latest on npm
Audit
Dependencies
start-on-windows-bootrequiredHandles the low-level Windows registry manipulation for creating the startup entry.
Agent activity
8 hits · last 30 days
node
8
Resources
pm2-windows-startup — npm install pm2-windows-startup · libregistry