📅  最后修改于: 2023-12-03 15:18:04.355000             🧑  作者: Mango
If you're a developer who frequently interacts with various versions of Node.js, you're likely familiar with nvm (Node Version Manager). With nvm installed on your system, you can easily switch between different versions of Node.js on the fly, without having to manually uninstall and reinstall different versions every time you want to use a different one.
If you're also a fan of the Fish shell, you can use nvm seamlessly within your Fish shell environment. Here's how:
Install nvm: First, you'll need to install nvm on your system if you haven't already done so. You can follow the instructions provided at the nvm website (https://github.com/nvm-sh/nvm) to get started.
Install Fish shell: If you haven't already installed Fish shell, you'll need to do so. You can find instructions for installing Fish shell on your system on the Fish shell website (https://fishshell.com/).
Set up Fish shell: Once you have Fish shell installed, you'll need to configure it to use nvm. Add the following code to your Fish shell configuration file (usually located at ~/.config/fish/config.fish):
# Set up nvm for Fish shell
source (nvm which)
This will enable Fish shell to use nvm commands.
nvm ls
This should display a list of all the installed versions of Node.js on your system, as managed by nvm.
Congratulations! You're now ready to use nvm within your Fish shell environment. Enjoy the convenience of easily switching between different Node.js versions without any hassle!
Note: Make sure to restart your Fish shell or open a new shell window after making changes to your Fish shell configuration file, in order for the changes to take effect.