Read this in other languages: 中文
Fish shell integration for Node Version Manager (nvm) on Arch Linux.
- ✅ Fixed version number writing issue:
.nvmrcnow correctly records the actual Node.js version instead of always writing 4.0.8 - ✅ Eliminated automatic prompts: No more unwanted
.nvmrcmanagement prompts when switching directories - ✅ Enhanced automatic switching: Fixed syntax errors when
.nvmrccontains npm version information - ✅ Improved parent directory support: Now finds
.nvmrcfiles in parent directories recursively - ✅ Optimized performance: Prevents duplicate
nvm usecalls and reduces unnecessary version switching - ✅ Better user interaction: Improved terminal input handling and error recovery
- ✅ Robust error handling: Enhanced stty configuration management and fail-safe mechanisms
- 🎯 Smarter version detection: Accurately extracts semantic versions from complex nvm output
- 🚀 Faster directory navigation: No delays when entering directories with
.nvmrcfiles - 🔧 Intelligent prompts: Cleaner, more intuitive user interaction flow
- 📁 Recursive configuration: Automatically uses parent
.nvmrcfiles in subdirectories
This package provides nvm (Node Version Manager) integration for Fish shell on Arch Linux. It allows you to use nvm commands in Fish shell and supports automatic Node.js version switching via .nvmrc files.
- 🐟 Complete Fish Shell Integration: All nvm commands work seamlessly in Fish
- 🎯 Automatic Version Switching: Support for .nvmrc files with automatic directory-based switching
- 🔧 Intelligent Dependency Management: Automatic bass detection and installation
- 📦 Zero-Pollution Installation: No disruption to existing Fish environment
- ⚡ Ready to Use: Works immediately after installation, no configuration needed
nvm- Node Version Manager (from Arch Linux extra repository)fish- Fish shellbass- Bash to Fish translation tool (automatically managed)
# Using yay or other AUR helper
yay -S nvm-fish
# Or build manually
git clone https://aur.archlinux.org/nvm-fish.git
cd nvm-fish
makepkg -siOne-time setup with nvm init command:
- Detects and installs bass (bash-to-fish adapter)
- Sets up Fish shell integration automatically
- Enables automatic .nvmrc version switching
After installation, initialize nvm-fish once:
# Initialize nvm-fish (run once after installation)
nvm init
# Then you can use all nvm features normally
nvm --version
nvm install node
nvm use nodeThe nvm init command will:
- ✅ Detect and install bass dependency (via plugin managers or manual installation)
- ✅ Configure Fish shell integration automatically
- ✅ Enable automatic .nvmrc version switching
- ✅ Set up everything needed for seamless nvm usage
After running nvm init, you can use all nvm commands normally:
# Check nvm version
nvm --version
# Install latest Node.js
nvm install node
# Install specific version
nvm install 18.17.0
# Switch version
nvm use 18
# Set default version
nvm alias default 18
# List installed versions
nvm ls
# List available versions
nvm ls-remote
# Install LTS version
nvm install --ltsCreate a .nvmrc file for automatic version switching:
# Create .nvmrc in project root
echo "18.17.0" > .nvmrc
# nvm will automatically switch to the specified version when you enter the directory
cd your-projectThis package provides four main Fish functions:
nvm- Uses bass to call the original bash nvm commands (checks for initialization first)nvm_find_nvmrc- Find .nvmrc files in current or parent directoriesload_nvm- Automatically load appropriate Node.js version when directory changes__nvm_setup_bassand related helper functions - Intelligent bass environment management
During nvm init, the bass dependency is handled intelligently:
- Detect Existing Installation: First checks if bass is already installed
- Plugin Manager Support: Detects and uses fisher, Oh My Fish, fundle automatically
- Manual Installation: Downloads source from GitHub and installs to user's Fish functions if no plugin manager
- Environment Protection: Manual installation integrates cleanly with Fish's function system
If bass installation fails, you can install it manually:
# Install fisher then bass
curl -sL https://raw.githubusercontent.com/jorgebucaran/fisher/main/functions/fisher.fish | source
fisher install jorgebucaran/fisher
fisher install edc/bass
# Or install Oh My Fish then bass
curl https://raw.githubusercontent.com/oh-my-fish/oh-my-fish/master/bin/install | fish
omf install bassIf you see "Unknown command" errors:
- Restart Fish shell:
exec fish - Or reload configuration:
source ~/.config/fish/config.fish
Make sure you have permissions to install packages. Some AUR helpers may require sudo.
Q: nvm commands don't work after installation?
A: Please restart your Fish shell or run exec fish. This is normal Fish behavior.
Q: Can this coexist with existing bash nvm installation? A: Yes! This package uses the official nvm package as a dependency, so it's fully compatible.
Q: Automatic version switching doesn't work?
A: Make sure load_nvm is added to your config.fish. Running nvm init handles this automatically, but if you've manually modified your config file, you may need to re-add it.
Contributions are welcome! Please:
- Fork this repository
- Create a feature branch:
git checkout -b my-new-feature - Commit your changes:
git commit -am 'Add some feature' - Push to the branch:
git push origin my-new-feature - Submit a Pull Request
MIT License - consistent with the upstream nvm project.