From 20 minutes to an hour. The devs are aware.
If you want to take your tidy-up routine to the next level, you can also run brew cleanup . This command removes downloads for outdated formulas and casks. ~ brew help cleanup Remove stale lock files and outdated downloads for all formulae and casks, and remove old versions of installed formulae.
Try removing the Homebrew process locks with this command:
rm -rf /usr/local/var/homebrew/locks
As this thread suggests at some point, my problem was to run brew command with sudo privileges for the first time. This causes brew to try to access privileged files and folders and it fails. If that's the case for you, run these commands and try installing node again.
sudo chown -R "$USER":admin /usr/local
brew cleanup
just close the terminal and reopen another
Simply type the following into your terminal:
brew cleanup
This should clean up any issues. Follow the command with:
brew doctor
All done.
In my case on OSX, I interrupted node install and then I try to start install node again so I got the error mentioned in the question.
I tried below steps from other responses:
sudo chown -R "$USER":admin /usr/local
brew cleanup
and
rm -rf /usr/local/var/homebrew/locks
but this message appear again - so don't know if above steps helped.
Then I closed the terminal tab and in new one ran
brew install -v node
It took 11 minutes to finish successfully node installation
Change file permission will avoid this error:
sudo chown <your-username>:admin /usr/local/Homebrew/Library/Homebrew/utils/lock.sh
For permission issues with homebrew install or update:
Change your homebrew permission setting
sudo chown -R <your-username>:admin /usr/local/Homebrew
sudo chown -R <your-username>:admin /usr/local/var/homebrew
Then run homebrew install or update
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With