1

I suspect because my LaunchAgents on MacBook has been interrupted this is what I get when I run…

$ ls -ld ~/Library/LaunchAgents
lrwxr-xr-x  1 infacq  staff  46 Aug 16 11:03 /Users/infacq/Library/LaunchAgents -> /usr/local/opt/mysql/homebrew.mxcl.mysql.plist

When try to install other stuff using brew it will simply state missing directory. This is what I get when try to perform other stuff.

ERROR  watchman--no-pretty get-sockname returned with exit code null 2016-01-23T07:35:13,560: [cli] Failed to open /Users/infacq/Library/LaunchAgents/com.github.facebook.watchman.plist for write: No such file or directory

Error: watchman--no-pretty get-sockname returned with exit code null 2016-01-23T07:35:13,560: [cli] Failed to open /Users/infacq/Library/LaunchAgents/com.github.facebook.watchman.plist for write: No such file or directory

    at ChildProcess.<anonymous> (/Users/infacq/Documents/weekdays/node_modules/fb-watchman/index.js:198:18)
    at emitTwo (events.js:87:13)
    at ChildProcess.emit (events.js:172:7)
    at maybeClose (internal/child_process.js:821:16)
    at Socket.<anonymous> (internal/child_process.js:319:11)
    at emitOne (events.js:77:13)
    at Socket.emit (events.js:169:7)
    at Pipe._onclose (net.js:469:12)

How do I fix this?

2
  • Your title is extremely unclear. Can you be more specific with the problem you are facing?
    – grg
    Jan 22 '16 at 19:05
  • @grgarside The other packages are "bitching" since the directory to store other plist files isn't a directory. I would say asking for a specific brew command that fails and the error message would be useful - but I'm fairly certain my answer will solve the issues...
    – bmike
    Jan 22 '16 at 19:55
2

Oops is the sound your Mac is making.

I would make a Time Machine backup just in case (or equivalent).

Then you need to remove the link:

rm ~/Library/LaunchAgents

Make that directory again (and optionally restore anything from your backup that is now missing)

mkdir -p ~/Library/LaunchAgents

You can then safely re-enable the mysql launch job:

  ln -sfv /usr/local/opt/mysql/*.plist ~/Library/LaunchAgents
5
  • 1
    Once that is done - perhaps check things with brew doctor
    – bmike
    Jan 22 '16 at 4:47
  • is that safe to perform rm? I have remove mysql before this. But not aware it links to the lauchAgents
    – Muhaimin
    Jan 22 '16 at 6:56
  • 1
    In your case, the rm deletes a symbolic link. Your system is broken specifically because what should be a folder is actually pointing to a file. The rm doesn't affect mysql or the plist file - just a pointer to that file that happens to be named LaunchAgents. I'm presuming it links since your ls -ld ~/Library/LaunchAgents shows me it's a link. In general the rm isn't desirable, but it's safe since a folder can't be removed with rm that lacks other options.
    – bmike
    Jan 22 '16 at 15:48
  • I updated my question
    – Muhaimin
    Jan 22 '16 at 23:42
  • @MuhaiminAbdul the answer still fits the edited question :)
    – bmike
    Jan 23 '16 at 15:56

You must log in to answer this question.

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