Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Some commands not being found after installing Oh-My-Zsh on mac

Before installing the Oh-My-Zsh terminal, i had installed node, npm and brew. But after installing Oh-My-Zsh, i get these errors:

➜  ~ node
zsh: command not found: node
➜  ~ npm
zsh: command not found: npm
➜  ~ brew
zsh: command not found: brew
➜  ~ 

I searched about it for a while and found that using:

source ~/.bash_profile;

at the end of the .zshrc file doesn't work, since i don't have a bash_profile file. And uncommenting the following line at the beginning:

export PATH=$HOME/bin:/usr/local/bin:$PATH

of the .zshrc file doesn't work either. How can fix this?

like image 597
Joao Victor Avatar asked Sep 14 '25 22:09

Joao Victor


1 Answers

if you look in the .zshrc.pre-oh-my-zsh , you find some export for NVM_DIR.

  export NVM_DIR="$HOME/.nvm"
  [ -s "/opt/homebrew/opt/nvm/nvm.sh" ] && . "/opt/homebrew/opt/nvm/nvm.sh"  # This loads nvm
  [ -s "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm" ] && . "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm"  # This loads nvm bash_completion

i solved my pb by adding

source $HOME/.zshrc.pre-oh-my-zsh 

at the end of the .zshrc and now nvm ( and node -v / ng etc .. ) are working again.

like image 75
laurent andre Avatar answered Sep 17 '25 18:09

laurent andre