Every time I open a new session with tmux I get this error and need to run a command to solve it.
I am using oh-my-zsh. It work on Terminal as well as iTerm, the problem persist only with Tmux.
Note that nvm when installed by homebrew is unsupported; what happens if you brew uninstall it, and use the curl script in the readme?
Fixed: it looks like this might be specific to how macOS handles pathes on each bash shell. Adding the recommended path-clearing logic to my profile files fixed this issue for me.
Seeing this too, just on tmux, with nvm installed via the curl script.
Oddly, it seems like I'm using different versions of npm when in tmux and when I'm just in my shell (zsh). When I'm in tmux, doing a which npm results in /usr/local/bin/npm while in zsh, it's /Users/brett/.nvm/versions/node/v10.8.0/bin/npm.
It seems like it might be related to tmux reloading my profile files, and appending more paths to $PATH.
@sohkai thanks you. Adding the recommended path-clearing logic to my profile files fixed this issue also for me.
@sohkai thanks, that's super helpful!
@sohkai what do you mean by "my profile files"?
I tried adding this to ~/.profile but it didnt work :(
@jklepatch it could be any of:
~/.profile~/.bashrc~/.bash_profile~/.zshrcthx. In the end I updated nvm and it fixed the problem.
Most helpful comment
Fixed: it looks like this might be specific to how macOS handles pathes on each bash shell. Adding the recommended path-clearing logic to my profile files fixed this issue for me.
Seeing this too, just on tmux, with
nvminstalled via the curl script.Oddly, it seems like I'm using different versions of
npmwhen in tmux and when I'm just in my shell (zsh). When I'm in tmux, doing awhich npmresults in/usr/local/bin/npmwhile in zsh, it's/Users/brett/.nvm/versions/node/v10.8.0/bin/npm.It seems like it might be related to tmux reloading my profile files, and appending more paths to $PATH.