Skip to content

Instantly share code, notes, and snippets.

@mike-casas
Last active March 14, 2024 20:40
Show Gist options
  • Star 75 You must be signed in to star a gist
  • Fork 18 You must be signed in to fork a gist
  • Save mike-casas/6d489bebf48d89f5109cd1395aabe150 to your computer and use it in GitHub Desktop.
Save mike-casas/6d489bebf48d89f5109cd1395aabe150 to your computer and use it in GitHub Desktop.
install nvm on mac with zsh shell
After install zsh
- brew update
- brew install nvm
- mkdir ~/.nvm
after in your ~/.zshrc or in .bash_profile if your use bash shell:
export NVM_DIR=~/.nvm
source $(brew --prefix nvm)/nvm.sh
@mike-casas
Copy link
Author

I use

  • Mac os Big Sur (11.7.4)
  • zsh instead of bash

When I restart terminal, it doesn't recognise the nvm command. What should I do to solve this issue with .zshrc?

Thanks for your help

please recheck in your ~/.zshrc file this lines :

export NVM_DIR=~/.nvm
source $(brew --prefix nvm)/nvm.sh

@js-Quest
Copy link

thanks so much

@shrsing3
Copy link

shrsing3 commented Dec 6, 2023

/Users/shrsing3/.zshrc:59: command not found: brew
/Users/shrsing3/.zshrc:source:59: no such file or directory: /nvm.sh

I get the following error every time I open a new terminal session

@mike-casas
Copy link
Author

/Users/shrsing3/.zshrc:59: command not found: brew
/Users/shrsing3/.zshrc:source:59: no such file or directory: /nvm.sh

I get the following error every time I open a new terminal session

please try next lines in your .zshrc file in terminal

open ~/.zshrc

in the .zshrc add the next lines

export NVM_DIR=~/.nvm
source $(brew --prefix nvm)/nvm.sh

@fernandobusta
Copy link

Thanks! was about to waste an hour...

@vickfaby
Copy link

thank you! <3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment