Skip to content

Akhil16/nvm-manager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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-manager

Usage

Migrate global packages:

nvm-manager migrate

List all global packages:

nvm-manager list-all

Cleanup old Node.js versions:

nvm-manager cleanup

Install latest LTS and restore packages:

nvm-manager install-lts

Fix phantom versions:

nvm-manager fix-failed

Show all commands:

nvm-manager --help

Prerequisites

  • 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-failed

Fixes 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

  1. list-all: Switches to each Node version, reads global packages via npm ls -g --json, saves to consolidated list
  2. Cleanup: Detects latest LTS, preserves it, prompts to uninstall others with batch options
  3. Install: Compares installed vs latest package versions, prompts for missing/outdated packages
  4. 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.txt to 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! 🚀

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •