Another active Homebrew process is already in prog

2020-02-16 08:28发布

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?

标签: homebrew
7条回答
▲ chillily
2楼-- · 2020-02-16 08:42

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

查看更多
一纸荒年 Trace。
3楼-- · 2020-02-16 08:54

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.

⋊> brew --version
Homebrew 2.1.4
Homebrew/homebrew-core (git revision 97b15a; last commit 2019-06-07)
Homebrew/homebrew-cask (git revision 2a010; last commit 2019-06-07)
查看更多
叛逆
4楼-- · 2020-02-16 08:56

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

查看更多
冷血范
5楼-- · 2020-02-16 08:58

If the above answer does not resolve your problem try removing the homebrew process locks with this command:

rm -rf /usr/local/var/homebrew/locks
查看更多
家丑人穷心不美
6楼-- · 2020-02-16 09:00

Simply type the following into your terminal:

brew cleanup

This should clean up any issues. Follow the command with:

brew doctor

All done.

查看更多
混吃等死
7楼-- · 2020-02-16 09:04

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

查看更多
登录 后发表回答