nvm-manager
v1.0.4
Published
A modern CLI tool to manage Node.js versions and global packages using nvm/nvm-windows.
Downloads
10
Maintainers
Readme
npm install -g nvm-manager
nvm-manager
Modern CLI to manage Node.js versions and global npm packages using nvm or nvm-windows.
Features
- Migrate global packages to any Node.js version (
nvm-manager migrate) - List global npm packages for all Node.js versions (
nvm-manager list-all) - Cleanup old Node.js versions, keep only latest LTS (
nvm-manager cleanup) - Install latest Node.js LTS and restore global packages (
nvm-manager install-lts) - Fix phantom Node.js versions (
nvm-manager fix-failed) - Interactive prompts, batch options, and rich CLI feedback
- Cross-platform: Windows (nvm-windows), macOS/Linux (nvm)
Installation
npm install -g nvm-managerUsage
Migrate global packages:
nvm-manager migrateList all global packages:
nvm-manager list-allCleanup old Node.js versions:
nvm-manager cleanupInstall latest LTS and restore packages:
nvm-manager install-ltsFix phantom versions:
nvm-manager fix-failedShow all commands:
nvm-manager --helpPrerequisites
- nvm or nvm-windows installed and configured
- Node.js and npm available in your shell
- On Windows: NVM_HOME environment variable set
Troubleshooting
- If nvm commands are not found, ensure nvm is in your PATH and shell config
- For phantom versions, check and edit your nvm config/settings file
- For permission errors, run with appropriate privileges or manually delete version folders
MIT License
Fix Phantom Versions
nvm-manager fix-failedFixes Node.js versions that show in nvm list but cannot be uninstalled normally. Attempts manual folder deletion and provides guidance for config file cleanup.
📚 Command Help
nvm-manager --help # Show all commands
nvm-manager <command> --help # Show help for specific command 🔧 How It Works
- list-all: Switches to each Node version, reads global packages via
npm ls -g --json, saves to consolidated list - Cleanup: Detects latest LTS, preserves it, prompts to uninstall others with batch options
- Install: Compares installed vs latest package versions, prompts for missing/outdated packages
- Fix-Failed: Attempts
nvm uninstall, falls back to manual folder deletion, guides through config cleanup
🛠️ Troubleshooting
- Phantom versions persist: Check and edit
%NVM_HOME%\settings.txtto remove stale entries - Permission errors: Run with appropriate privileges or manually delete version folders
- nvm commands not found: Ensure nvm is in your PATH and shell environment is configured
- NVM_HOME not set: Set environment variable pointing to your nvm installation directory
📁 Project Structure
nvm-manager/
├── package.json
├── bin/
│ └── nvm-manager # CLI executable
├── src/
│ ├── index.js # Main CLI entry point
│ ├── utils.js # Shared utilities
│ └── commands/
│ ├── list-all.js # list-all command
│ ├── cleanup.js # Cleanup command
│ ├── install-lts.js # Install command
│ └── fix-failed.js # Fix-failed command
└── README.md🤝 Contributing
Issues, suggestions, and pull requests welcome!
📄 License
MIT License - Feel free to use, modify, and distribute.
🙏 Credits
Developed by Akhil Chaturvedi. Inspired by the need for a modern, cross-platform nvm global package manager and to fill gaps in nvm-windows.
Happy Node.js version management! 🚀
