nvm-sh / nvm

Node Version Manager - POSIX-compliant bash script to manage multiple active node.js versions
MIT License
80.32k stars 8.03k forks source link

nvm v0.36.0+ interferes with sed #2384

Open antgonzales opened 3 years ago

antgonzales commented 3 years ago

Operating system and version:

macOS Catalina v10.15.7

nvm debug output:

```sh nvm --version: v0.37.2 $TERM_PROGRAM: Apple_Terminal $SHELL: /usr/local/bin/zsh $SHLVL: 1 whoami: 'anthony.gonzales' ${HOME}: /Users/anthony.gonzales ${NVM_DIR}: '${HOME}/.nvm' ${PATH}: ${NVM_DIR}/versions/node/v14.15.2/bin:${HOME}/bin:/usr/local/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:${HOME}/.fzf/bin $PREFIX: '' ${NPM_CONFIG_PREFIX}: '' $NVM_NODEJS_ORG_MIRROR: '' $NVM_IOJS_ORG_MIRROR: '' shell version: 'zsh 5.8 (x86_64-apple-darwin19.6.0)' uname -a: 'Darwin 19.6.0 Darwin Kernel Version 19.6.0: Thu Oct 29 22:56:45 PDT 2020; root:xnu-6153.141.2.2~1/RELEASE_X86_64 x86_64' checksum binary: 'shasum' OS version: Mac 10.15.7 19H15 curl: /usr/bin/curl, curl 7.64.1 (x86_64-apple-darwin19.0) libcurl/7.64.1 (SecureTransport) LibreSSL/2.8.3 zlib/1.2.11 nghttp2/1.39.2 wget: not found sed: /usr/bin/sed cut: /usr/bin/cut basename: /usr/bin/basename rm: rm: aliased to nocorrect rm -i (nocorrect rm -i) mkdir: mkdir: aliased to nocorrect mkdir -p (nocorrect mkdir -p) xargs: /usr/bin/xargs ls: /usr/local/bin/git /usr/local/bin/git /usr/bin/git: No such file or directory git: /usr/local/bin/git /usr/local/bin/git /usr/bin/git, git version 2.29.2 ls: grep:: No such file or directory grep: grep: aliased to nocorrect grep --color=auto (nocorrect grep --color=auto), grep (BSD grep) 2.5.1-FreeBSD ls: /usr/local/bin/awk /usr/local/bin/awk /usr/bin/awk: No such file or directory awk: /usr/local/bin/awk /usr/local/bin/awk /usr/bin/awk, GNU Awk 5.1.0, API: 3.0 (GNU MPFR 4.1.0, GNU MP 6.2.1) nvm current: v14.15.2 which node: ${NVM_DIR}/versions/node/v14.15.2/bin/node which iojs: iojs not found which npm: ${NVM_DIR}/versions/node/v14.15.2/bin/npm npm config get prefix: ${NVM_DIR}/versions/node/v14.15.2 npm root -g: ${NVM_DIR}/versions/node/v14.15.2/lib/node_modules ```

nvm ls output:

```sh v12.20.0 v14.15.1 -> v14.15.2 system default -> lts/* (-> v14.15.2) iojs -> N/A (default) unstable -> N/A (default) node -> stable (-> v14.15.2) (default) stable -> 14.15 (-> v14.15.2) (default) lts/* -> lts/fermium (-> v14.15.2) lts/argon -> v4.9.1 (-> N/A) lts/boron -> v6.17.1 (-> N/A) lts/carbon -> v8.17.0 (-> N/A) lts/dubnium -> v10.23.0 (-> N/A) lts/erbium -> v12.20.0 lts/fermium -> v14.15.2 ```

How did you install nvm?

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash

What steps did you perform?

Installed zsh framework zprezto for simple terminal tools and plugins.

What happened?

After installing nvm, I noticed sed was interrupted when using zprezto's fasd module. It's a terminal tool to quickly jump between directories using 'j'. Here is the output when using v0.36.0+:

Screen Shot 2020-12-15 at 10 58 50 PM

What did you expect to happen?

I expected to use the terminal tool 'j' without interruption. I had to roll back to nvm v0.35.3 and it appears to work as expected now.

Is there anything in any of your profile files that modifies the PATH?

# ~/.zshrc
export PATH=$HOME/bin:/usr/local/bin:$PATH

#~/.fzf
export PATH="\${PATH:+\${PATH}:}$fzf_base/bin"
ljharb commented 3 years ago

I use autojump myself (which uses j), and haven't noticed any conflicts on bash.

I can't find any occurrence of this sed pattern in nvm.sh, and it's very unclear to me what between v0.35.3..v0.36.0 would have caused this issue (and in the 3 months since it's been released, you're the first one to have this issue).

If you're able to do git bisect, it'd be really helpful if you could help figure out which commit introduced the issue.