A plugin for profile.d that integrates nvm - Node Version Manager, a tool for managing multiple Node.js versions.
- Automatically installs and configures nvm
- Keeps nvm up-to-date with the latest version
- Loads nvm automatically in your shell
- Provides bash completion for nvm commands
- Maintains persistent NVM_DIR environment variable
- Add the following line to your
~/.profiledrc:
PLUGINS=(
# ... your other plugins ...
https://github.com/jakubro/profile.d-nvm
)- Run the installation commands:
profile.d-install
. ~/.bashrcOnce installed, you can use nvm to manage your Node.js installations:
# List available Node.js versions
nvm ls-remote
# Install a specific version
nvm install 18.0.0
# Use a specific version
nvm use 18.0.0
# Set default Node.js version
nvm alias default 18.0.0
# Run a command with a specific version
nvm exec 18.0.0 node --versionThe plugin:
- Installs nvm in
~/.nvmduring the installation phase - Updates nvm to the latest version when running
profile.d-install - Sets up the NVM_DIR environment variable
- Loads nvm and its bash completion on shell initialization
If you would like to contribute to this project, please feel free to submit a pull request or open an issue for discussion.
MIT License - see the LICENSE file for details.