Search code examples
bashpathbiniterm

PATH error: "not a valid identifier"


I had to get a new hard drive on my Mac and in setting up my developer environment, I'm getting this error/message in the terminal (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': not a valid identifier

From what I've been able to research myself so far, it might be related to installing node using brew. (I could be wrong.)

FYI:

which ruby /usr/bin/ruby

which node /usr/local/bin/node

which python /usr/local/bin/python

Also, I'm using these instructions to set up. I'm aware a few things in this list are out of date:

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

EDIT:

Contents of ~/.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"

Solution

  • The issue is this line in your ~/.bash_profile:

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

    comment it out with # and restart iTerm2