路径错误:"不是有效的标识符"

时间:2018-06-03 05:00:36

标签: bash path bin iterm

我必须在我的Mac上安装一个新的硬盘并设置我的开发者环境,我在终端(iTerm2)中收到此错误/消息:

-bash:unset:`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安装节点有关。 (我可能错了。)

仅供参考:

红宝石 的/ usr /斌/红宝石

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

哪个python 的/ usr / local / bin中/蟒

另外,我使用这些说明进行设置。我知道这个列表中的一些内容已经过时了:

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"

1 个答案:

答案 0 :(得分:1)

问题在于~/.bash_profile

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

使用#对其进行评论,然后重新启动iTerm2