Atom command not found


#1

Hi,

Im currently on MacOS ( version 10.12.1 ) and i’ve encountered a problem with the ‘atom’ command in my terminal. Suddenly my terminal could find the command.

I checked my $PATH to see if it changed, ‘/usr/local/bin’ was in it, as well as a symlink for atom. When i tried to see the original file for the symlink the OS prompted me with an error that the symlink was broken. (Note that I hadn’t changed anything that could trigger this problem).

After restarting my terminal emulator ( iTerm + Zsh shell ) and Atom as well the problem still encountered. A couple minutes later everything worked again.

Practically i did nothing, I haven’t changed my $PATH, I haven’t changed ~/.zshrc, I haven’t changed my symlink, only restarted both iTerm and Atom.

Luckily everything works again but I’m just curious for why this problem happened.
Does anyone have an idea?


#2

Told it wrong in my question, the symlink for atom was in ‘usr/local/bin’ not in $PATH.


#3

Atom assumes that /usr/local/bin is going to be in your PATH. If it isn’t, then the shell commands won’t work without some extra effort on your part.


#4

Been having the same issue on a clean install on 10.12. When I check the symlinks, they are present and are in the path. However, the symlinks that Atom generates point to

/private/var/folders/nh/86g1_vnj3vbb_1mw68xqmrqh0000gn/T/AppTranslocation/37441FE8-D9B7-4E2F-A0DB-0556B15000A3/d/Atom.app/Contents/Resources/app

as the base path for the apm and atom commands. If I delete and set them to be for the copy in the Applications folder, Atom tells me it needs to install newer versions and overwrites them to a path similar to above.

After further investigation, this appears to be a security feature in 10.12 and is quarantining Atom. Removing the following attribute solved the issue.

xattr -dr com.apple.quarantine /Applications/Atom.app

Although it does disable a security feature to do it.


#5

I am getting this same issue, but inconsistently. Sometimes it works in my terminal, sometimes it does not, and I can’t figure out how to replicate it accurately.

  rm /usr/local/bin/atom
  ln -s /Applications/Atom.app/Contents/Resources/app/atom.sh /usr/local/bin/atom

Always fixes it, but it is annoying to type.


#6

You could always make that a shell script that runs every time you type atom.


#7

I have it in a function in my bash_profile that I run when it happens, but running that every time I type atom ignores the issue. Something is broken, and I’d like it to be fixed, not patched.


#8

I got this unexpectedly. After I executed the command as “/usr/local/bin/atom .” instead of “atom .”, the latter command once again began succeeding.


#9

What does the command which atom print?


#10

It outputs /usr/local/bin/atom