asdf-nodejs: Failure when running `asdf list all nodejs` without recent bash installed, on macOS
Possibly related to #195?
Environment:
- macOS 11.1
asdf
v0.8.0 installed via Homebrew or Git- User shell: zsh
Problem
➜ ~ which bash
/bin/bash
➜ ~ /bin/bash --version
GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin20)
➜ ~ asdf list all nodejs
/Users/adamfeldman/.asdf/plugins/nodejs/bin/../lib/utils.sh: line 35: local: -A: invalid option
local: usage: local name[=value] ...
/Users/adamfeldman/.asdf/plugins/nodejs/bin/../lib/utils.sh: line 51: Fermium: unbound variable
[**OUTPUT TRUNCATED FOR BREVITY**]
➜ ~ ~/.asdf/plugins/nodejs/bin/list-all nodejs
/Users/adamfeldman/.asdf/plugins/nodejs/bin/../lib/utils.sh: line 35: local: -A: invalid option
local: usage: local name[=value] ...
/Users/adamfeldman/.asdf/plugins/nodejs/bin/../lib/utils.sh: line 51: Fermium: unbound variable
15.0.0 15.0.1 15.1.0 15.2.0 15.2.1 15.3.0 15.4.0 15.5.0 15.5.1 15.6.0
Solution
➜ ~ brew install bash
➜ ~ which bash
/usr/local/bin/bash
➜ ~ /usr/local/bin/bash --version
GNU bash, version 5.1.4(1)-release (x86_64-apple-darwin20.2.0)
➜ ~ ~/.asdf/plugins/nodejs/bin/list-all nodejs
0.1.14 [**OUTPUT TRUNCATED FOR BREVITY, worked exactly as-expected**] lts-fermium lts 15.0.0 15.0.1 15.1.0 15.2.0 15.2.1 15.3.0 15.4.0 15.5.0 15.5.1 15.6.0
➜ ~ asdf list all nodejs
[**OUTPUT TRUNCATED FOR BREVITY, worked exactly as-expected**]
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 10
- Comments: 15 (6 by maintainers)
Did you update your
asdf-nodejs
plugin? Runningasdf update nodejs
should be enough.I can’t reproduce this error using bash 3, so I don’t think it’s related to just the bash version
Thanks @adamfeldman. I had this issue on a brand new M1 MacBook and chalked it up at first to some of the ARM compatibility issues I expect to run into. Installing a newer version of Bash like you state worked for me as well.
I’m using Fish shell but probably wouldn’t normally think to update Bash even if I used it as my primary shell.
If possible we should stick with what is POSIX complaint. It’s not always possible but in this case I think it might be.