Node Version Switch Status Bar
A powerful VS Code extension that displays your current Node.js version in the status bar and allows easy switching between installed versions using popular version managers.

Screenshots

The extension displays your current Node.js version in the status bar

Click to open the version picker and switch between installed versions
Features
- 🚀 Version Switching: Click status bar to instantly switch between installed Node.js versions
- 🔄 Auto VS Code Reload: Automatically reloads VS Code after successful version switching
- 🧹 Automatic Terminal Cleanup: Terminals close automatically after operations complete
- 🛠️ Multi-Manager Support: Works with nvm, fnm, and volta version managers
- 📦 Install New Versions: Install new Node.js versions directly from VS Code
- 📋 One-Click Copy: Copy version to clipboard via command palette
- 🔄 Auto-Refresh: Optional automatic refresh at custom intervals
- ⚙️ Highly Customizable: Personalize display format and behavior
- 🛡️ Smart Error Handling: Clear indicators with actionable suggestions
- 🎯 Lightweight: Minimal performance impact on VS Code
- 🖥️ Enhanced Windows Support: Robust Windows NVM compatibility with multiple execution methods
Installation
From VS Code Marketplace
- Open VS Code
- Go to Extensions (
Ctrl+Shift+X
)
- Search for "Node Version Switch Status Bar"
- Click "Install"
Manual Installation
- Download the
.vsix
file from the releases page
- Open VS Code
- Press
Ctrl+Shift+P
and run "Extensions: Install from VSIX..."
- Select the downloaded file
Usage
Quick Start
- View Current Version: The extension automatically displays your Node.js version in the status bar
- Switch Versions: Click the status bar item to open version picker
- Install New Versions: Use Command Palette → "Node Version: Install Node Version"
Supported Version Managers
The extension automatically detects and works with:
Manager |
Support |
Installation |
Switching |
nvm |
✅ Full |
nvm install <version> |
nvm use <version> |
fnm |
✅ Full |
fnm install <version> |
fnm use <version> |
volta |
✅ Full |
volta install node@<version> |
volta install node@<version> |
Quick Actions
Action |
Description |
Click status bar item |
Open version picker to switch versions |
Command Palette → "Switch Node Version" |
Open version picker |
Command Palette → "Install Node Version" |
Install new Node.js version |
Command Palette → "Copy Node Version" |
Copy current version to clipboard |
Command Palette → "Refresh Node Version" |
Manually refresh displayed version |
Configuration
Customize the extension through VS Code settings (Ctrl+,
):
{
"nodeVersion.showInStatusBar": true,
"nodeVersion.statusBarText": "$(symbol-method) Node {version}",
"nodeVersion.refreshInterval": 0,
"nodeVersion.preferredManager": "auto",
"nodeVersion.showSwitchButton": true
}
Available Settings
Setting |
Type |
Default |
Description |
nodeVersion.showInStatusBar |
boolean |
true |
Show/hide the Node.js version in status bar |
nodeVersion.statusBarText |
string |
"$(symbol-method) Node {version}" |
Custom display format. Use {version} as placeholder |
nodeVersion.refreshInterval |
number |
0 |
Auto-refresh interval in seconds (0 = disabled) |
nodeVersion.preferredManager |
string |
"auto" |
Preferred version manager: auto , nvm , fnm , volta |
nodeVersion.showSwitchButton |
boolean |
true |
Enable clicking status bar to switch versions |
You can customize how the version appears using these examples:
// Simple text
"nodeVersion.statusBarText": "Node {version}"
// With emoji
"nodeVersion.statusBarText": "⚡ {version}"
// With VS Code icons
"nodeVersion.statusBarText": "$(logo-github) Node.js {version}"
"nodeVersion.statusBarText": "$(gear) {version}"
"nodeVersion.statusBarText": "$(rocket) Node {version}"
// Minimal
"nodeVersion.statusBarText": "{version}"
Version Manager Preferences
Control which version manager to use when multiple are available:
// Auto-detect (default)
"nodeVersion.preferredManager": "auto"
// Force specific manager
"nodeVersion.preferredManager": "nvm"
"nodeVersion.preferredManager": "fnm"
"nodeVersion.preferredManager": "volta"
Commands
The extension provides these commands (accessible via Ctrl+Shift+P
):
- Node Version: Switch Node Version - Open interactive version picker
- Node Version: Install Node Version - Install new Node.js versions
- Node Version: Refresh Node Version - Manually refresh the displayed version
- Node Version: Copy Node Version - Copy the current Node.js version to clipboard
Version Management Workflow
Switching Between Versions
- Click Status Bar: Click the Node.js version in the status bar
- Select Version: Choose from the list of installed versions
- Automatic Processing: Extension handles switching with multiple execution methods
- Auto Reload: VS Code automatically reloads to apply changes
Progress Indicators:
- "Executing switch command..." - Running version manager with fallback methods
- "Verifying switch..." - Confirming the switch was successful
- "Switch completed!" - Version verified and VS Code ready to reload
Windows NVM Enhancements:
- Multiple Execution Methods: cmd.exe, PowerShell, and environment-specific execution
- Automatic Fallback: If one method fails, tries alternative approaches
- Enhanced Terminal: Detailed feedback with step-by-step verification
Installing New Versions
- Open Command Palette: Press
Ctrl+Shift+P
- Run Install Command: Type "Node Version: Install Node Version"
- Choose Manager: Select version manager if multiple are available
- Enter Version: Type version number (e.g.,
18.17.0
, lts
, latest
)
- Watch Terminal: Installation progress shown in integrated terminal
Format |
Example |
Description |
Specific |
18.17.0 |
Exact version number |
Latest |
latest |
Latest stable release |
LTS |
lts |
Latest LTS version |
Named LTS |
lts/hydrogen |
Specific LTS codename |
Major |
18 |
Latest in major version |
Troubleshooting
Windows NVM Compatibility Issues
Problem: "NVM for Windows should be run from terminal such as CMD or Powershell"
Automatic Solutions (Extension handles these automatically):
- Dynamic NVM Path Detection: Automatically locates
nvm.exe
using NVM_HOME
, %APPDATA%\nvm
, or system PATH.
- Enhanced CMD Execution: Uses
cmd.exe /K
to maintain NVM environment during command execution.
- Error Logging: Detailed console logs for debugging failed commands.
- Fallback Terminal: Persistent terminal with extended timeouts to ensure command completion.
- Verification: Confirms version switch success with robust checks.
Manual Verification:
# Test NVM installation
nvm version
nvm list
echo %NVM_HOME%
# Verify NVM path
where nvm.exe
### Windows NVM Issues
**Problem**: "NVM for Windows should be run from terminal such as CMD or Powershell"
**Solutions**:
1. **Automatic Fix**: Extension now handles this automatically by using proper CMD execution
2. **Manual Verification**: Check that NVM for Windows is properly installed:
```cmd
nvm version
nvm list
### Version Manager Not Detected
**Problem**: Status bar shows warning or no versions found
**Solutions**:
1. **Install a Version Manager**:
```bash
# Install nvm (recommended)
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
# Install fnm (fast alternative)
curl -fsSL https://fnm.vercel.app/install | bash
# Install volta (Rust-based)
curl https://get.volta.sh | bash
- Restart VS Code after installation
- Check PATH: Ensure version manager is in your system PATH
Node.js Version Not Showing
Problem: Status bar shows "Node.js not found" or warning icon
Solutions:
Verify Installation:
node --version
nvm --version # or fnm --version, volta --version
Install Node.js:
# Using nvm
nvm install node
nvm use node
# Using fnm
fnm install --lts
fnm use lts-latest
# Using volta
volta install node
Manual Refresh: Use "Node Version: Refresh Node Version" command
Version Switching Not Working
Problem: Selected version doesn't become active
Solutions:
- Reload VS Code: Some version managers require VS Code restart
- Check Terminal: Look for error messages in the integrated terminal
- Manual Terminal: Try switching manually in terminal first
- Path Issues: Ensure version manager's PATH modifications are loaded
Permission Issues
Problem: Extension shows error during version operations
Solutions:
- Check Permissions: Ensure write permissions to Node.js installation directories
- Run as Admin: On Windows, try running VS Code as administrator
- Terminal Permissions: Check if your terminal has proper permissions
Advanced Usage
Workspace-Specific Versions
The extension respects .nvmrc
files and package.json engine specifications:
// package.json
{
"engines": {
"node": ">=18.0.0"
}
}
# .nvmrc file
18.17.0
Integration with Build Scripts
Use the extension with your development workflow:
// package.json scripts
{
"scripts": {
"dev": "node --version && npm run start",
"prebuild": "node --version"
}
}
Multiple Project Management
When working with multiple projects requiring different Node.js versions:
- Auto-Switch: Extension detects version requirements
- Quick Switch: Use status bar for rapid version changes
- Project-Specific: Each workspace can have different active versions
Development
Building from Source
Clone Repository:
git clone https://github.com/shababulalam/node-version-statusbar.git
cd node-version-statusbar
Install Dependencies:
npm install
Compile TypeScript:
npm run compile
Run in Development:
- Open project in VS Code
- Press
F5
to launch Extension Development Host
- Test features in the new VS Code window
Available Scripts
npm run compile # Compile TypeScript
npm run watch # Watch for changes and compile
npm run lint # Run ESLint
npm run test # Run tests
Architecture
The extension is built with a modular architecture:
- NodeVersionProvider: Main class handling status bar and version management
- VersionManager Interface: Abstraction for different version managers
- Version Detection: Smart parsing of version manager outputs
- Error Handling: Comprehensive error handling and user feedback
Contributing
Contributions are welcome! Here's how to get started:
Development Guidelines
- Code Style: Follow existing TypeScript conventions
- Testing: Add tests for new features
- Documentation: Update README and changelog
- Compatibility: Ensure backward compatibility
Feature Requests
Popular requested features in development:
- Automatic version switching based on project requirements
- Integration with Docker and containers
- Support for additional version managers
- Custom installation paths
- Team/workspace version synchronization
Bug Reports
When reporting bugs, please include:
- VS Code version
- Extension version
- Operating system
- Version manager and versions
- Steps to reproduce
- Error messages or logs
Changelog
[1.4.1] - Latest Release ✨
- Dynamic NVM Path Detection: Automatically locates
nvm.exe
using NVM_HOME
, %APPDATA%\nvm
, or system PATH for reliable Windows NVM operations.
- Enhanced Terminal Stability: Improved CMD execution with persistent
/K
flag and extended timeouts to ensure command completion.
- Robust Error Handling: Added detailed console logs and user-friendly error messages to guide troubleshooting of NVM issues.
[1.4.0]
- Automatic Terminal Cleanup: Terminals now close automatically after operations
- Enhanced Resource Management: Better memory usage and cleaner VS Code interface
- Smart Cleanup Timing: Intelligent delays ensure output visibility before cleanup
[1.3.1]
- Enhanced Windows NVM Support: Terminal approach first functionality added
[1.3.0]
- Automatic VS Code Reload: Seamless version switching with auto-reload functionality
- Enhanced Windows NVM Support: Multiple execution methods for maximum compatibility
- Robust Error Handling: Automatic fallback methods for reliable operation
- Version Switch Verification: Ensures switches work before proceeding
- Enhanced Progress Reporting: Detailed status updates during all operations
- Terminal Integration: Improved terminal handling for complex environments
[1.2.0]
- Automatic VS Code Reload: Seamless version switching with auto-reload
- Windows NVM Compatibility: Fixed NVM for Windows terminal errors
- Version Switch Verification: Ensures switches actually work before proceeding
- Enhanced Progress Reporting: Detailed status updates during operations
[1.1.0]
- Node.js Version Switching: Click status bar to switch between versions
- Multi-Manager Support: nvm, fnm, and volta support
- Install New Versions: Direct installation from VS Code
- Enhanced UI: Beautiful version picker interface
[1.0.0] - Initial Release
- Display Node.js version in status bar
- Copy version to clipboard
- Customizable display format
- Auto-refresh capability
View Full Changelog
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
- Thanks to the VS Code team for excellent extension APIs
- Inspired by the Node.js community and version management tools
- Special thanks to contributors and users providing feedback
Enjoy seamless Node.js version management! 🚀
If you find this extension useful, please consider:
- ⭐ Starring the repository on GitHub
- 📝 Writing a review on the VS Code Marketplace
- 🐦 Sharing with your developer community
- 💬 Contributing ideas and feedback