我尝试在我的 Mac 上下载 Spicetify(自定义 Spotify 的终端应用程序)。
我运行了安装命令,但安装成功后。我尝试运行
spicetify --help
,但我的终端找不到命令 spicetify
。
即使我浏览了我的
<username>
文件夹并找到了 .spicetify folder
,可能意味着它已成功安装。我决定重新安装它。安装过程如下:
myname@My-MacBook-Air ~ % curl -fsSL https://raw.githubusercontent.com/spicetify/spicetify-cli/master/install.sh | sh
FETCHING Version 2.27.0
DOWNLOADING https://github.com/spicetify/spicetify-cli/releases/download/v2.27.0/spicetify-2.27.0-darwin-arm64.tar.gz
######################################################################## 100.0%
EXTRACTING /Users/me/.spicetify/spicetify.tar.gz
SETTING EXECUTABLE PERMISSIONS TO /Users/me/.spicetify/spicetify
REMOVING /Users/me/.spicetify/spicetify.tar.gz
spicetify path already set in /Users/me/.zshrc, continuing...
spicetify v2.27.0 was installed successfully to /Users/me/.spicetify
Run 'spicetify --help' to get started
myname@My-MacBook-Air ~ % spicetify --help
zsh: command not found: spicetify
myname@My-MacBook-Air ~ %
我相信这个问题的根源在我的
.zshrc
文件中。我记得我对它做了一些改变,但不记得是什么了。这是目前的样子:
#export PATH="$HOME/Users/me/Desktop/zsh commands:$PATH"
#export PATH=$PATH:/Users/me/.spicetify
我应该取消注释这两行吗?这些线有什么作用? (我不知道zsh是如何工作的)
这似乎是一个路径问题。看看这个。
这就是目前的样子:
#export PATH="$HOME/Users/me/Desktop/zsh commands:$PATH" #export PATH=$PATH:/Users/me/.spicetify
我应该取消注释这两行吗?
我建议您取消注释第二行(
#export PATH=$PATH:/Users/me/.spicetify
),关闭终端,重新打开并重试。
该行将
/Users/me/.spicetify
路径附加到系统 $PATH
变量。该 $PATH
环境变量告诉系统在您输入二进制文件时在哪里搜索它们。
因此,在这种情况下,您输入
spicetify --help
,但它无法找到 spicetify
二进制文件,直到您将 /Users/me/.spicetify
添加到 $PATH
环境变量中。然后关闭终端并重新打开它,重新加载 .zshrc
,然后就一切就绪了。