Homebrew node installation fails on cannot link c-ares - macos

If I run brew install node I get this error:
==> Installing dependencies for node: c-ares, icu4c, libnghttp2, libuv and openssl#1.1
Error: Cannot link c-ares
Another version is already linked: /usr/local/Cellar/c-ares/1.17.1
Anybody know how to resolve this?

Hm, it appears Homebrew tried to upgrade c-ares from version 1.17.1 to 1.18.1 but failed for some reason. Try running brew upgrade c-ares before brew install node.
If that doesn't work, what is your output for brew list --versions c-ares? Perhaps you have multiple c-ares versions installed. If that is the case, run brew unlink c-ares to unlink the old version and then brew link c-ares to link the newer one. The old version can be uninstalled by running brew cleanup c-ares

Related

How to update cocoapod version using brew

I've installed cocoapods by this - https://apple.stackexchange.com/questions/418222/installing-cocoapods-to-macos-catalina/418230#418230
It istalled cocoapods v1.5.2. Now I want to update the version to the latest v1.10.0.
So I've used -
brew upgrade cocoapods
I've also tried this -
brew install cocoapods#1.10.0
But I'm getting -
Error: This command updates brew itself, and does not take formula names.
Use `brew upgrade cocoapods` instead.
Fahims-Mac-mini:~ fahimrahman$ brew upgrade cocoapods
Fahims-Mac-mini:~ fahimrahman$ brew upgrade cocoapods
Fahims-Mac-mini:~ fahimrahman$ brew install cocoapods#1.10.0
==> Searching for similarly named formulae...
Error: No similarly named formulae found.
Error: No available formula or cask with the name "cocoapods#1.10.0".
==> Searching for a previously deleted formula (in the last month)...
Error: No previously deleted formula found.
==> Searching taps on GitHub...
Error: No formulae found in taps.
Also tried this -
sudo gem install cocoapods
but still is not working on my device. So How can I update the cocoapods version using brew?
I had the same issue and resolved. This was bugging me, since in the website https://formulae.brew.sh/formula/cocoapods latest stable is 1.10.1 but still brew installed me1.5.4
Figure out The problem by using
brew doctor
I got the below warning.
Some taps are not on the default git origin branch and may not receive
updates. If this is a surprise to you, check out the default branch with:
git -C $(brew --repo homebrew/core) checkout master
Then, as per suggestion, I did. (Fix the related issues which comes for you)
git -C $(brew --repo homebrew/core)
Then, brew install cocoapods installed the latest version for me.
Hope it solves.
You can't do much with homebrew.
Homebrew allows installing v1.10.1 only
In my case fix this issue by updating ruby to 2.7 to install cocoapods v1.10.0.
rvm install ruby-2.7
Note: Use the specific version of ruby as per your macOS compatibility
I uninstalled brew uninstall cocoapods then reinstalled by sudo gem install cocoapods , it worked.
For me brew upgrade cocoapods shows Warning: cocoapods 1.11.2_2 already installed, so I've unistalled them with brew uninstall cocoapods and the install again with brew install cocoapods and now pod --version shows 1.11.3
I used brew upgrade cocoapods and it works just fine. Take a look at these terminal screenshots. brew upgrade cocoapods
upgrading cocoapods

How to update chromedriver to the latest version on MacOS using homebrew?

My current version is 81.0.4044.69 and I want to update to the latest version 83.0.4103.39
When I open Terminal and I do:
brew cask install chromedriver
It says:
Warning: Cask 'chromedriver' is already installed.
How can I update to the latest version 83.0.4103.39?
UPDATE: Now you can also do:
brew update
brew upgrade chromedriver
or
brew update
brew upgrade --cask chromedriver
Also be aware that after each upgrade you will get again a system warning when using the chromedriver for the first time so you need to click Cancel in the warning and then go to "Preferences => Security & Privacy" and click "Allow Anyway" to accept the risk. Then on the next run, you'll have to click "Open" once.
Note: The answer below was given for an older version and may not work anymore
I found out that I should do:
brew update
brew cask upgrade chromedriver
Another option is to uninstall and install it again like this:
brew cask uninstall chromedriver
==> Uninstalling Cask chromedriver
==> Unlinking Binary '/usr/local/bin/chromedriver'.
==> Purging files for version 81.0.4044.69 of Cask chromedriver
brew cask install chromedriver
==> Downloading https://chromedriver.storage.googleapis.com/83.0.4103.39/chromedriver_mac64.zip
######################################################################## 100.0%
==> Verifying SHA-256 checksum for Cask 'chromedriver'.
==> Installing Cask chromedriver
==> Linking Binary 'chromedriver' to '/usr/local/bin/chromedriver'.
🍺 chromedriver was successfully installed!
Now:
chromedriver --version
ChromeDriver 83.0.4103.39 (ccbf011cb2d2b19b506d844400483861342c20cd-refs/branch-heads/4103#{#416})
I would recommend start using webdriver-manager:
pip install webdriver-manager
what I prefer mostly and use it like:
from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager
driver = webdriver.Chrome(ChromeDriverManager().install())
with that package you should not worry about version of chromedriver, even though, you can even choose particular chrome driver version:
driver = webdriver.Chrome(ChromeDriverManager(version='86.0.4240.22').install())
it is not the solution of the ticket, but it makes live easier working with chromedriver
Now its just brew upgrade chromedriver no longer cask
Uninstalling & installing the chromedriver worked -
brew uninstall chromedriver
brew install --cask chromedriver
I have recently have issues where I would receive a warning about chromedriver's developer not being trusted. To resolve this I use brew info chromedriver which gives the directory for chromedriver. Change into that directory and type ls -l and if the code like drwxr-xr-x has an # at the end, that means your mac has quarantined that file. To pull it out of quarantine, type xattr -d com.apple.quarantine chromedriver. Then you should be good to go.
When I initially ran the following commands,
brew upgrade chromedriver
brew upgrade --cask chromedriver
brew uninstall chromedriver
I got the error below.
Error: Cask 'chromedriver' is not installed.
So I had to remove the chromedriver not managed by Homebrew first.
rm `which chromedriver`
After that, brew install chromedriver successfully installed the latest version.

When brew does not have latest package version

How do I force brew to install latest version of neovim (ver 0.5.0) when brew's formula only has 0.4.3?
I have tried:
brew update
brew upgrade neovim
And it says: Warning: neovim 0.4.3 already installed
I went brew's git repo and checked on neovim formula. Brew has neovim's 0.4.3, not 0.5.0. So brew update/upgrade is not going to help. https://github.com/Homebrew/homebrew-core/blob/master/Formula/neovim.rb
I'm thinking of just downloading neovim from neovim repo and installing it manually, but I'm afraid I'll have to manage updates and dependencies if I do this manual install.
curl -LO https://github.com/neovim/neovim/releases/download/nightly/nvim-macos.tar.gz
tar xzf nvim-macos.tar.gz
./nvim-osx64/bin/nvim
What should I do?
I fixed this with the following steps:
1) Unlink old neovim version:
brew unlink neovim ... and 2)
Install pointing to head:
brew install --HEAD neovim
... This installed neovim 0.5.0.
According to the brew doc, brew install --HEAD will install the master branch of the package. For neovim, it means that the latest version of neovim will be built for you, which may not be stable enough or even compile.
I suggest you install the nightly binary version of neovim. The best way to get the nightly version is to download from the binary release. No dependency is required to install if you download the binary release.
If you don't want to do this manually, you can write a bash script to automate this.

Switching Ruby versions using homebrew

One of the projects that I've been working has a dependency on ruby#2.3.
I'm using a Mac and the version of Ruby that I used for other projects is the 2.5.
I want to temporarily switch from 2.5 to 2.3 using brew. I don't want to use neither rbenv nor rvm.
1. I've installed the 2.3.7 version, using brew:
bf-old> brew install ruby#2.3
Warning: ruby#2.3 2.3.7 is already installed and up-to-date
To reinstall 2.3.7, run `brew reinstall ruby#2.3
2. I'm trying to switch to it, but it's not working:
bf-old> brew switch 2.3.7
Error: 2.3.7 not found in the Cellar.
What can I do about this?
Check if both the ruby versions are installed.
If both are installed, then try this:
brew unlink ruby#2.5 && brew link --force --overwrite ruby#2.3

SVN 1.8.4 libserf-1.1.3.0.dylib

After I updated SVN version on my mac using homebrew I'm getting following error:
dyld: Library not loaded: /usr/local/lib/libserf-1.1.3.0.dylib
Referenced from: /Applications/Xcode.app/Contents/Developer/usr/bin/svn
Reason: image not found
Trace/BPT trap: 5
I have no idea what libserf-1.1.3.0.dylib is and where it should be!
Any thought?
[UPDATE 01]
I tried installing serf using following:
brew install serf
and got the following error:
Error: No available formula for serf
also I checked svn dependncies on homebrew by doing brew deps svn there is no serf:
autoconf
automake
libtool
pkg-config
scons
sqlite
Got it working.
If you want the latest svn uninstall and then build from source
brew remove svn
brew install --build-from-source svn
If you want an older version (I needed 1.6.17) then follow the direction here, but replace the line that says brew install with the install command from above (don't forget to remove svn first though)
If anyone has httpd installed with brew these commands worked for me:
brew unlink httpd
brew install svn
brew link httpd
Hope this helps!

Resources