0

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"
l'L'l
  • 44,951
  • 10
  • 95
  • 146
Chuck LaPress
  • 278
  • 1
  • 10
  • 18
  • How/where is the `unset` being command issued? – l'L'l Jun 03 '18 at 05:13
  • Post the output of `~/.bash_profile` (eg. `cat ~/.bash_profile`) – l'L'l Jun 03 '18 at 05:17
  • # 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" – Chuck LaPress Jun 03 '18 at 05:29
  • [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function* – Chuck LaPress Jun 03 '18 at 05:29
  • It's probably this line `unset fileexport PATH="/usr/local/opt/icu4c/bin:$PATH"`... comment it out by adding `#` in front of it, then re-save the file. Then close `iTerm2`, relaunch it and see if the problem persists. – l'L'l Jun 03 '18 at 05:33
  • Please add code to your question, not into a comment - it makes it very difficult to read and we can't see where line breaks occur. – cdarke Jun 03 '18 at 05:36
  • You are probably doing `unset $PATH` instead of `unset PATH`. – cdarke Jun 03 '18 at 05:42
  • 1
    Thank you, @l'L'l. That did it. – Chuck LaPress Jun 03 '18 at 05:59

1 Answers1

1

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

l'L'l
  • 44,951
  • 10
  • 95
  • 146