You can use zsh-nvm or enable it yourself by adding following lines to your ~/.zshrc

 export NVM_DIR=~/.nvm
 [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"

Extra:

For faster shell initialization, I use lazynvm which only loads node when needed

lazynvm() {
  unset -f nvm node npm
  export NVM_DIR=~/.nvm
  [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"  # This loads nvm
}

nvm() {
  lazynvm 
  nvm $@
}
 
node() {
  lazynvm
  node $@
}
 
npm() {
  lazynvm
  npm $@
}

npx() {
  lazynvm
  npx $@
}

Reference: Lazy load nvm for faster shell start

Answer from Ryan W on Stack Overflow
🌐
GitHub
gist.github.com › tomsihap › e703b9b063ecc101f5a4fc0b01a514c9
Install NVM in Ubuntu 18.04 with ZSH · GitHub
Install NVM in Ubuntu 18.04 with ZSH. GitHub Gist: instantly share code, notes, and snippets.
🌐
DEV Community
dev.to › saanchitapaul › install-nvm-node-version-manager-inside-zsh-34ke
Install nvm (Node Version Manager) inside zsh - DEV Community
March 16, 2023 - To install nvm (Node Version Manager) inside zsh, you can follow these steps: Open your terminal and... Tagged with nvm, node, zsh, linux.
🌐
GitHub
github.com › nvm-sh › nvm
GitHub - nvm-sh/nvm: Node Version Manager - POSIX-compliant bash script to manage multiple active node.js versions
Create one with touch ~/.zshrc and run the install script again. If you use bash, the previous default shell, your system may not have .bash_profile or .bashrc files where the command is set up.
Starred by 90.3K users
Forked by 9.7K users
Languages   Shell 98.0% | Makefile 1.2%
🌐
Medium
medium.com › @shaxzad544 › install-nvm-node-version-manager-in-zsh-on-a-linux-system-follow-these-simple-steps-4d5dc355428f
Install nvm (Node Version Manager) in zsh on a Linux system, follow these simple steps: | by shaxzad ali | Medium
December 28, 2023 - Install nvm (Node Version Manager) in zsh on a Linux system, follow these simple steps: First, open your terminal. 2. Type cd ~ to go to your home directory. 3. Type git clone …
🌐
Jimfrenette
jimfrenette.com › 2018 › 04 › wsl-ubuntu-zsh-nvm-etc
WSL ubuntu zsh nvm etc. | JimFrenette.com
By default, Yarn installs nodejs as a system-wide dependency. After updating your .zshrc profile to load the nvm plugin, close and re-open the Ubuntu app and to install nvm when the plugin is loaded for the first time.
🌐
GoLinuxCloud
golinuxcloud.com › home › ubuntu › how to install nvm on ubuntu? [solved]
How to install NVM on Ubuntu? [SOLVED] | GoLinuxCloud
January 1, 2024 - * (HEAD detached at FETCH_HEAD) master => Compressing and cleaning up git repository => Appending nvm source string to /home/foc/.bashrc => Appending bash_completion source string to /home/foc/.bashrc => Close and reopen your terminal to start using nvm or run the following to use it now: export NVM_DIR="$HOME/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion · Reload the .bashrc: foc@ubuntu22:~$ source ~/.bashrc · If you are using different shell the command should be different, For example: zsh: source ~/.zshrc · ksh: . ~/.profile · Installed NVM version: foc@ubuntu22:~$ nvm --version 0.39.2 ·
Find elsewhere
🌐
Boekhoff
boekhoff.info › how-to-install-nodejs-and-npm-using-nvm-and-zsh-nvm
How to install NodeJS and NPM using NVM and Zsh-NVM?
Load Zsh-NVM as a Zsh-plugin. Therefore simply add plugins+=(zsh-nvm) to your ~/.zshrc. When opening a new terminal window, NVM will be automatically installed by Zsh-NVM.
🌐
TecAdmin
tecadmin.net › how-to-install-nvm-on-ubuntu-20-04
How To Install NVM on Ubuntu 20.04 – TecAdmin
April 26, 2025 - Here is the step-by-step instructions to install and use NVM on Ubuntu systems.
🌐
Medium
medium.com › @agarwalprashant355 › how-do-i-install-nvm-802a66f2662
How do i install NVM?. If you get the error “zsh
December 8, 2022 - You can do this by running source ~/.zshrc (or the path to your shell configuration file) in your terminal. Once nvm is installed and properly configured in your shell, you should be able to run the nvm command without getting the "zsh: command not found: nvm" error.
🌐
Qirolab
qirolab.com › posts › how-to-install-nvm-node-version-manager-on-ubuntu-system
How To Install NVM (Node Version Manager) on Ubuntu System? | Qirolab
January 16, 2021 - curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash · The script clones the nvm repository to ~/.nvm, and attempts to add the source lines from the snippet below to the correct profile file (~/.bash_profile, ~/.zshrc, ~/.profile, or ~/.bashrc).
🌐
GitHub
github.com › lukechilds › zsh-nvm
GitHub - lukechilds/zsh-nvm: Zsh plugin for installing, updating and loading nvm
Zsh plugin for installing, updating and loading nvm - lukechilds/zsh-nvm
Starred by 2.4K users
Forked by 119 users
Languages   Shell
🌐
Communityhealthtoolkit
forum.communityhealthtoolkit.org › technical support
Error while piping nvm to zsh shell during installation - Technical Support - Community Health Toolkit
May 24, 2023 - Hi everyone, I am using Ubuntu 22.04 and on zsh shell. While following the instructions to Install NodeJS, npm, and Docker as part of the CHT Core dev environment setup I ran into an issue. I ran the first command and that worked as expected. export nvm_version=`curl -s https://api.github.com/repos/nvm-sh/nvm/releases/latest | jq -r .name` However, when I ran the second command curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/$nvm_version/install.sh | $SHELL .
🌐
PhoenixNAP
phoenixnap.com › home › kb › devops and development › how to install nvm on ubuntu
How to Install NVM on Ubuntu | phoenixNAP KB
April 24, 2025 - Note: For other shells, adjust the profile accordingly (e.g., ~/.zshrc for zsh). 4. Check the NVM version to verify the installation: ... Once NVM is installed and running on your Ubuntu system, you can manage multiple Node.js versions.
🌐
4Geeks
4geeks.com › how-to › install-nvm-linux
How to Install NVM on Linux (Ubuntu and Centos)
July 15, 2025 - Before installing NVM on your Linux system, make sure you have: A standard Linux distribution such as Ubuntu, Debian, CentOS, or Fedora.
🌐
DigitalOcean
digitalocean.com › community › tutorials › how-to-install-node-js-on-ubuntu-22-04
How to Install Node.js on Ubuntu (Step-by-Step Guide) | DigitalOcean
May 28, 2025 - Open your shell configuration file ... for Zsh) with nano ~/.bashrc and add the following line at the end of the file: export PATH="$HOME/.local/node-v20.19.2/bin:$PATH" Save the file. Then apply the changes to your current terminal session: ... This will output the version of node and npm you just compiled. Finally, you can remove the downloaded tarball and the extracted source directory to save disk space: ... You can uninstall Node.js using apt or nvm, depending on how it was installed...
🌐
TecAdmin
tecadmin.net › how-to-install-nvm-on-ubuntu-22-04
How To Install NVM on Ubuntu 22.04 – TecAdmin
April 26, 2025 - NVM stands for Node Version Manager. It is a command-line tool that lets you install, manage, and use multiple Node.js versions. It allows you to switch between versions for different projects, ensuring compatibility and avoiding conflicts. You need an Ubuntu 22.04 Linux system with shell access.