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
@daniela-green
Copy link

Helpful, thanks!

@jesper-bylund
Copy link

Very helpful, thank you!

@damoncp
Copy link

damoncp commented Nov 26, 2020

Works for me, thx for share ~~

@sweicharles
Copy link

thank you so much!

@danielRicaud
Copy link

Worked great! Thanks Mike!

@MarceloRomero
Copy link

Gracias, !Maestro!

@an-parubets
Copy link

Thank! It work for me

@mkezfarias
Copy link

Super helpful !!! thank you so much!

@cjcheshire
Copy link

Thanks! 💃

@Nickx58
Copy link

Nickx58 commented Aug 31, 2021

Thanks

@msindelic
Copy link

Thank you so much.Very useful.👍👋

@dnwSilver
Copy link

My regards! 👏🏻

@caprica-Six
Copy link

Awesome, thanks!

@0xtaosu
Copy link

0xtaosu commented Jan 11, 2022

Hey! I found it not work when I try to open a new terminal . Do you have any idea ?

@cjcheshire
Copy link

Did you enter directly in your terminal @0xtaosu? It sounds like it isn't correctly added to your ~/.zshrc or in .bash_profile.

@wsixsix
Copy link

wsixsix commented Feb 9, 2022

good job

@codeTIT4N
Copy link

thank you so much for this. it worked 😇

@hu-qi
Copy link

hu-qi commented May 19, 2022

Thanks! Good job! 🎉

@mghabdo
Copy link

mghabdo commented May 20, 2022

@brenoprata10 also for me
thanks

@renoirb
Copy link

renoirb commented Nov 26, 2022

Quick heads up.

If you use ZSH, and use Oh-My-ZSH, you don't need to add to ~/.zshrc

Just follow instructions for lukechilds/zsh-nvm at the section as a ZSH plugin

# ~/.zshrc


# Which plugins would you like to load?
# Standard plugins can be found in $ZSH/plugins/
# Custom plugins may be added to $ZSH_CUSTOM/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.

plugins=(
  nvm
)

export ZSH="$HOME/.oh-my-zsh"
source $ZSH/oh-my-zsh.sh

# ...

@oikonomopo-k
Copy link

@renoirb just followed lukechilds/zsh-nvm at the section as a ZSH plugin instructions and worked like a charm! Thanks!

@claranceliberi
Copy link

@renoirb your recommended way works just fine

@oleh-hrinishyn
Copy link

helped

@hakuna0829
Copy link

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

@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