为什么我不能在 macOS Catalina 中使用 Homebrew 最近安装的软件包?
Why can't I start using a recently installed package with Hombrew in macOS Catalina?
我最近安装了 macOS Catalina 并尝试安装 Homebrew + NVM,但似乎我没有正确安装。
看来我安装NVM就好了
wayoshi@Uwu-MacBook-Pro ~ % brew list
nvm
但是我不能使用这个包:
wayoshi@Uwu-MacBook-Pro ~ % nvm install 12.21.0
zsh: command not found: nvm
我的 ~/.zshrc
里有这个
export PATH=$HOME/bin:/usr/local/bin:$PATH
export PATH=$HOME/bin:/usr/local/sbin:$PATH
这就是我在 运行 printf '%s\n' $path
时得到的结果
/Users/wayoshi/bin
/usr/local/sbin
/Users/wayoshi/bin
/usr/local/bin
/Users/wayoshi/bin
/usr/local/sbin
/Users/wayoshi/bin
/usr/local/bin
/usr/local/bin
/usr/bin
/bin
/usr/sbin
/sbin
我想这与环境变量有关。你知道为什么会这样吗?
说 brew info nvm
以获取有关如何配置 shell 以查看 nvm 的说明。听起来你没有遵循这些说明:
You should create NVM's working directory if it doesn't exist:
mkdir ~/.nvm
Add the following to /Users/<you>/.bash_profile or your desired shell
configuration file:
export NVM_DIR="$HOME/.nvm"
[ -s "/usr/local/opt/nvm/nvm.sh" ] && . "/usr/local/opt/nvm/nvm.sh" # This loads nvm
[ -s "/usr/local/opt/nvm/etc/bash_completion.d/nvm" ] && . "/usr/local/opt/nvm/etc/bash_completion.d/nvm" # This loads nvm bash_completion
我最近安装了 macOS Catalina 并尝试安装 Homebrew + NVM,但似乎我没有正确安装。
看来我安装NVM就好了
wayoshi@Uwu-MacBook-Pro ~ % brew list
nvm
但是我不能使用这个包:
wayoshi@Uwu-MacBook-Pro ~ % nvm install 12.21.0
zsh: command not found: nvm
我的 ~/.zshrc
export PATH=$HOME/bin:/usr/local/bin:$PATH
export PATH=$HOME/bin:/usr/local/sbin:$PATH
这就是我在 运行 printf '%s\n' $path
/Users/wayoshi/bin
/usr/local/sbin
/Users/wayoshi/bin
/usr/local/bin
/Users/wayoshi/bin
/usr/local/sbin
/Users/wayoshi/bin
/usr/local/bin
/usr/local/bin
/usr/bin
/bin
/usr/sbin
/sbin
我想这与环境变量有关。你知道为什么会这样吗?
说 brew info nvm
以获取有关如何配置 shell 以查看 nvm 的说明。听起来你没有遵循这些说明:
You should create NVM's working directory if it doesn't exist:
mkdir ~/.nvm
Add the following to /Users/<you>/.bash_profile or your desired shell
configuration file:
export NVM_DIR="$HOME/.nvm"
[ -s "/usr/local/opt/nvm/nvm.sh" ] && . "/usr/local/opt/nvm/nvm.sh" # This loads nvm
[ -s "/usr/local/opt/nvm/etc/bash_completion.d/nvm" ] && . "/usr/local/opt/nvm/etc/bash_completion.d/nvm" # This loads nvm bash_completion