When I try to do this:
brew install node
I get this message:
/usr/local/Homebrew/Library/Homebrew/utils/lock.sh: line 19: /usr/local/var/homebrew/locks/update: Permission denied
-e:1:in `initialize': Bad file descriptor (Errno::EBADF)
from -e:1:in `new'
from -e:1:in `<main>'
Error: Another active Homebrew process is already in progress.
Please wait for it to finish or terminate it to continue.
Error: Permission denied - /usr/local/var/homebrew/locks/node.brewing
Any idea on how to solve this?
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
I don't know what was going on. My only active terminal was waiting for input, no jobs running in the background. I had just tried to run an RVM install that failed and asked me to update Homebrew but that was supposed to be finished since the terminal was waiting for input. After several repeat command invocations and a couple of minutes later I stopped receiving the message.
This is on Mac OSX 10.13.6 with iTerm2.
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:
and
but this message appear again - so don't know if above steps helped.
Then I closed the terminal tab and in new one ran
It took 11 minutes to finish successfully node installation
If the above answer does not resolve your problem try removing the homebrew process locks with this command:
Simply type the following into your terminal:
This should clean up any issues. Follow the command with:
All done.
Change file permission will avoid this error:
For permission issues with homebrew install or update:
Change your homebrew permission setting
Then run homebrew install or update