Fish NVM is a lightweight, minimalist package that integrates the Node Version Manager (NVM) into the Fish shell, enabling smoother Node.js workflow for Fish users.
Fish NVM is designed to perform the bare necessities required to harmonize NVM with the Fish shell. Here are its core features:
- Augments Fish with
nvm
andnvm_find_nvmrc
functions. - Automatically detects and loads the Node.js version specified in the
.nvmrc
file in the current directory or any parent directory. - If the required Node.js version specified in the
.nvmrc
file isn't installed yet, it triggers the installation process. - Closer directory traversal: Fish NVM searches for the
.nvmrc
file in the current directory first, then in the parent directory, and so on, until it reaches the root directory.
Before you install Fish NVM, make sure NVM is installed on your system. If you haven't installed it yet, you can do so using Homebrew:
brew install nvm
Once NVM is ready, install the Fish NVM package using Fisher:
fisher install aohorodnyk/fish-nvm
Fish NVM relies on the Bass package for optimum performance. Install it with Fisher:
fisher install edc/bass
Fish NVM is designed to work out of the box. However, you can customize its behavior by setting the following environment variables:
nvmrc_enable
(default:yes
): Enables or disables Fish NVM. Set tono
to disable.nvmrc_announce
(default:yes
): Enables or disables the announcement of the Node.js version change. Set tono
to disable.
After successful installation, Fish NVM operates automatically. Whenever you navigate into a directory containing a .nvmrc
file (either in the current directory or any parent directory), Fish NVM auto-detects and loads the required version of Node.js. If the required version isn't installed, Fish NVM initiates the installation process.