doctorfree / nvim-lazyman

Neovim configuration manager and Lazy/Lua/Mason based Neovim config. Manage multiple Neovim configurations with the lazyman command. ☕
https://lazyman.dev
MIT License
263 stars 8 forks source link

Lazyman fails to load configs - `readarray: command not found` #65

Closed jaredtconnor closed 5 months ago

jaredtconnor commented 5 months ago

Hey there,

So I installed Lazyman, and anytime I start it I'm getting:

/Users/jaredconnor/.local/bin/lazyman: line 2144: readarray: command not found
xargs: /bin/echo: terminated with signal 13; aborting

The package is able to install configs it seems, but all of the functionality for reading what's installed or loaded does not work.

Environment:

Has anyone ran into this? Or have any solutions?

Screenshot 2024-03-27 at 12 57 23 PM
doctorfree commented 5 months ago

Hi, I believe this is due to the default bash that ships with macOS being woefully out of date. On my MacBook Pro the defalt bash is version 3.2. The readarray builtin appeared in bash version 4. To use a modern bash on macOS you can install either the Homebrew or Macports bash. For example (I use Homebrew):

brew install bash

Then add the path to the updated bash prior to /bin in your PATH environment variable.

doctorfree commented 5 months ago

The lazyman initialization process on macOS installs Homebrew if not already installed and then installs bash with Homebrew. So you may already have the Homebrew bash installed but you are not picking it up because your PATH is not set correctly. I believe Homebrew installs bash as /opt/homebrew/bin/bash. Can you check to see if that exists?

Finally, the Homebrew installation should add a line like the following to your ~/.zshrc:

eval "$(/opt/homebrew/bin/brew shellenv)"

If something like that is in your ~/.zshrc then all you need do is logout and login or source ~/.zshrc and you should pick up the Homebrew bash (try type bash to see which bash is getting picked up).

jaredtconnor commented 5 months ago

Gotcha! Perfect explanation, that seems to have been the issue. To re-iterate if anyone also runs into this error:

  1. Install/ensure bash >= 4 is installed: brew install bash
  2. Ensure eval "$(/opt/homebrew/bin/brew shellenv)" is appended onto your ~/.zshrc file, and sourced

If anyone is using bash as their default shell with macOS, this might be of value to you.

Lastly, @doctorfree - Great work on this project, love what you have done so far, it's great.