Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nvm version-remote --lts fails with bash: PATTERN: unbound variable #1949

Closed
balupton opened this issue Nov 22, 2018 · 3 comments
Closed

nvm version-remote --lts fails with bash: PATTERN: unbound variable #1949

balupton opened this issue Nov 22, 2018 · 3 comments
Labels
bugs Oh no, something's broken :-(

Comments

@balupton
Copy link

balupton commented Nov 22, 2018

  • Operating system and version:
Darwin balbook-2018.local 18.2.0 Darwin Kernel Version 18.2.0: Fri Oct  5 19:41:49 PDT 2018; root:xnu-4903.221.2~2/RELEASE_X86_64 x86_64
  • nvm debug output:
nvm --version: v0.33.11
$TERM_PROGRAM: Apple_Terminal
$SHELL: /usr/local/bin/fish
$SHLVL: 2
$HOME: /Users/balupton
$NVM_DIR: '$HOME/.nvm'
$PATH: /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/VMware Fusion.app/Contents/Public:$HOME/bin:$HOME/.scripts/users/balupton/commands:/usr/local/opt/go/libexec/bin:$HOME/go/bin:/usr/local/opt/openssl/bin:/usr/local/opt/sqlite/bin:/usr/local/opt/gettext/bin:/usr/local/opt/icu4c/sbin:/usr/local/opt/icu4c/bin:$HOME/.gem/ruby/2.5.0/bin:/usr/local/sbin:/Applications/Xcode.app/Contents/Developer/usr/bin:$HOME/.scripts/commands
$PREFIX: ''
$NPM_CONFIG_PREFIX: ''
$NVM_NODEJS_ORG_MIRROR: ''
$NVM_IOJS_ORG_MIRROR: ''
shell version: 'fish, version 2.7.1'
uname -a: 'Darwin 18.2.0 Darwin Kernel Version 18.2.0: Fri Oct 5 19:41:49 PDT 2018; root:xnu-4903.221.2~2/RELEASE_X86_64 x86_64'
OS version: Mac 10.14.1 18B75
curl: /usr/bin/curl, curl 7.54.0 (x86_64-apple-darwin18.0) libcurl/7.54.0 LibreSSL/2.6.4 zlib/1.2.11 nghttp2/1.24.1
wget: /usr/local/bin/wget, GNU Wget 1.19.5 built on darwin17.5.0.
git: /usr/local/bin/git, git version 2.19.1
grep: /usr/bin/grep, grep (BSD grep) 2.5.1-FreeBSD
awk: /usr/bin/awk, awk version 20070501
sed: illegal option -- -
usage: sed script [-Ealn] [-i extension] [file ...]
       sed [-Ealn] [-i extension] [-e script] ... [-f script_file] ... [file ...]
sed: /usr/bin/sed, 
cut: illegal option -- -
usage: cut -b list [-n] [file ...]
       cut -c list [file ...]
       cut -f list [-s] [-d delim] [file ...]
cut: /usr/bin/cut, 
basename: illegal option -- -
usage: basename string [suffix]
       basename [-a] [-s suffix] string [...]
basename: /usr/bin/basename, 
rm: illegal option -- -
usage: rm [-f | -i] [-dPRrvW] file ...
       unlink file
rm: /bin/rm, 
mkdir: illegal option -- -
usage: mkdir [-pv] [-m mode] directory ...
mkdir: /bin/mkdir, 
xargs: illegal option -- -
usage: xargs [-0opt] [-E eofstr] [-I replstr [-R replacements]] [-J replstr]
             [-L number] [-n number [-x]] [-P maxprocs] [-s size]
             [utility [argument ...]]
xargs: /usr/bin/xargs, 
nvm current: system
which node: /usr/local/bin/node
which iojs: 
which npm: /usr/local/bin/npm
npm config get prefix: /usr/local
npm root -g: /usr/local/lib/node_modules
  • nvm ls output:
> nvm ls
        v0.8.28
       v0.10.48
       v0.12.18
         v4.9.1
        v6.14.4
        v8.12.0
       v10.13.0
        v11.2.0
->       system
default -> system
node -> stable (-> v11.2.0) (default)
stable -> 11.2 (-> v11.2.0) (default)
iojs -> N/A (default)
unstable -> N/A (default)
lts/* -> lts/dubnium (-> v10.13.0)
lts/argon -> v4.9.1
lts/boron -> v6.14.4
lts/carbon -> v8.13.0 (-> N/A)
lts/dubnium -> v10.13.0
bash
git clone git@github.com:creationix/nvm.git
set -xueE -o pipefail
source ./nvm/nvm.sh 
nvm version-remote --lts
  • What happened?
+ shift
+ '[' 0 -gt 0 ']'
+ case "${PATTERN}" in
bash: PATTERN: unbound variable
  • What did you expect to happen?
    it to work

  • Is there anything in any of your profile files (.bashrc, .bash_profile, .zshrc, etc) that modifies the PATH?
    not applicable

@balupton
Copy link
Author

Considering unbound errors have been reported before, perhaps it would make sense for the nvm test suite to adopt a "bash strict mode" like set -ueE -o pipefail

balupton added a commit to bevry-archive/awesome-travis that referenced this issue Nov 22, 2018
@ljharb
Copy link
Member

ljharb commented Nov 22, 2018

I'd be happy to accept a PR that updates the tests to set the u option :-)

@ljharb
Copy link
Member

ljharb commented Nov 22, 2018

Hmm, I can't reproduce this locally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugs Oh no, something's broken :-(
Projects
None yet
Development

No branches or pull requests

2 participants