Related issue: #1505
hmm, the code you linked to has the variable set here, which should mean it's always bound.
although I can repro it locally, so i'll figure it out shortly :-)
The issue is this snippet:
if [ "${ALIAS-}" = '--' ]; then
unset ALIAS
fi
nvm_list_aliases "${ALIAS}"
The unset line is (in some cases, I don't understand nvm well enough to know when the condition fires) removing the variable. A smaller test case:
$ cat test.sh
#!/bin/bash -u
a="3"
echo $a
unset a
echo $a
$ ./test.sh
3
./test.sh: line 5: a: unbound variable
Thanks, turns out it's a simple fix.
Looking at the code in nvm_list_aliases, you can probably replace unset ALIAS with ALIAS=""...? That function looks defensively written :)
馃憤 thanks!