This was asking you to install igraph
When you used dependencies=TRUE R tried to install it for you but very likely faild because you where missing system dependencies.
Then you installed the system dependencies (C compilers) with Homebrew and probably that solved the source of your issues.
This is my best guest of what happened, but package installation issues are very specific so next time an error message asks you to install a package, try to install just that package and see if you get an specific error message so you can keep tracking the root problem.