首页 文章

PATH错误:“不是有效的标识符”

提问于
浏览
0

我必须在我的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安装节点有关 . (我可能是错的 . )

供参考:

ruby / usr / bin / ruby

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

哪个python / usr / local / bin / python

另外,我正在使用这些说明进行设置 . 我知道这个列表中的一些东西已经过时了:

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

EDIT

〜/ .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 回答

  • 1

    问题是 ~/.bash_profile 中的这一行:

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

    # 注释掉并重启 iTerm2

相关问题