PATH error: "not a valid identifier"

PATH error: "not a valid identifier"

我不得不在我的 Mac 上安装一个新硬盘,在设置我的开发环境时,我在终端 (iTerm2) 中得到这个 error/message:

-bash:取消设置:`PATH=/usr/local/opt/icu4c/bin:/usr/local/share/npm/bin:/Users/(mycomputername)/bin:/usr/local/bin:/usr/local/bin: /usr/bin:/bin:/usr/sbin:/sbin:/Users/(mycomputername)/bin': 不是有效标识符

根据我迄今为止能够研究的内容,它可能与使用 brew 安装节点有关。 (我可能是错的。)

仅供参考:

哪个ruby /usr/bin/ruby

哪个节点 /usr/local/bin/节点

哪个python /usr/local/bin/python

此外,我正在使用这些说明进行设置。我知道此列表中的一些内容已过时:

https://github.com/nicolashery/mac-dev-setup

编辑:

~/.bash_profile的内容:

# Add Homebrew /usr/local/bin and User ~/bin to the $PATH 

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

# Load the shell dotfiles, and then some: # * ~/.path can be used to extend $PATH. 
# * ~/.extra can be used for other settings you don’t want to commit. 

for file in ~/.{path,bash_prompt,exports,aliases,functions,extra}; 
    do [ -r "$file" ] && source "$file" 
done 

unset fileexport PATH="/usr/local/opt/icu4c/bin:$PATH" 
export PATH="/usr/local/opt/icu4c/sbin:$PATH"

问题出在您 ~/.bash_profile:

中的这一行
unset fileexport PATH="/usr/local/opt/icu4c/bin:$PATH"

#注释掉然后重启iTerm2