6

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?

Mo Fatty
  • 317
  • 2
  • 8

2 Answers2

11

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.

Mo Fatty
  • 317
  • 2
  • 8
  • 1
    note that as of now, [Neovim 0.5.0 is released](https://github.com/neovim/neovim/releases/tag/v0.5.0), so `brew install neovim` will get you that version. If you've been using the --HEAD version to get 0.5 (like I was), you can now do `brew unlink neovim && brew install neovim` to get of the pre-release train, and stay with the stable released version. – postylem Jul 03 '21 at 21:41
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.

jdhao
  • 24,001
  • 18
  • 134
  • 273
  • According to [the docs](https://github.com/neovim/homebrew-neovim#install) it will, actually. – jweyrich Jun 14 '20 at 05:53
  • @jweyrich That repo has been deprecated a long time. `brew install --HEAD neovim` will install the master branch of neovim, which may not be stable. – jdhao Jun 14 '20 at 09:13