When I open the Terminal I keep getting this message, which I suppose is some error:

/Users/sinisasasic/.zshrc:export:48: not valid in this context: Support/GoodSync:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin

Can anybody help me in translating what this exactly means and what should I do to resolve it, if it’s some problem?

1 Answer 1


.zshrc is a file run when you start an interactive zsh shell, found in your home directory. The error message says you have an export command which is written incorrectly on line 48. not valid in this context means you're trying to export something that's not a variable. It looks like you're trying to add stuff to your PATH, but are substituting the current path inside the zshrc file. Check that line in the file, there's probably a line along the lines of:

export $PATH=/some/directory/to/add/to/path/:$PATH

You just need to remove the first $ because it's substituting the current path there instead of assigning the PATH variable:

export PATH=/some/directory/to/add/to/path/:$PATH

See https://stackoverflow.com/questions/22394367/zsh-error-export54-not-valid-in-this-context

  • I changed the line per your suggestion however the problem persists — it still shows the same message with 2 new error messages added: /Users/sinisasasic/.zshrc:export:48: not valid in this context: Support/GoodSync:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin /Users/sinisasasic/.rvm/scripts/rvm:12: command not found: uname /Users/sinisasasic/.rvm/scripts/rvm:14: command not found: ps Commented Aug 18, 2014 at 10:22
  • 1
    @SinišaŠašić Can you give the text of your .zshrc file around line 48 and the output of echo $PATH? Commented Aug 18, 2014 at 16:13
  • 1
    @SinišaŠašić I see the problem. In the first line, you have Application Support The space is screwing it up. You can escape it by putting Application\ Support instead, but having spaces in paths can screw things up in some cases, so it may be better to make a symlink of that directory to a path without spaces. Commented Aug 18, 2014 at 22:43
  • 1
    @SinišaŠašić Close, but your link command is wrong, try: ln -s ~/Library/Application\ Support ~/Library/ApplicationSupport The export line looks okay. Commented Aug 19, 2014 at 16:42
  • 1
    The second PATH should have a $. Basically, putting a $ makes it substitute the current value of that variable instead of referring to the actual variable. The first PATH has no $ because you're trying to assign the variable, the second has a $ because you want to append those paths to the existing paths in the variable. e.g. if the value of PATH is /usr/bin, then echo $PATH will print /usr/bin but echo PATH just prints PATH because it's just a name, the $ resolves the variable to its value. Commented Aug 20, 2014 at 16:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .