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

npx nvmrc passes but zsh integration shows error #3435

Open
jchoi2x opened this issue Sep 24, 2024 · 2 comments
Open

npx nvmrc passes but zsh integration shows error #3435

jchoi2x opened this issue Sep 24, 2024 · 2 comments

Comments

@jchoi2x
Copy link

jchoi2x commented Sep 24, 2024

Operating system and version:

OSX/Linux

nvm debug output:

nvm --version: v0.40.1
$TERM_PROGRAM: Apple_Terminal
$SHELL: /bin/zsh
$SHLVL: 1
^Pwhoami: 'james.choi'
${HOME}: /Users/james.choi
${NVM_DIR}: '${HOME}/.nvm'
${PATH}: /opt/homebrew/opt/make/libexec/gnubin:/opt/homebrew/opt/gsed/libexec/gnubin:/opt/homebrew/opt/grep/libexec/gnubin:/opt/homebrew/opt/gnu-which/libexec/gnubin:/opt/homebrew/opt/gnu-tar/libexec/gnubin:/opt/homebrew/opt/gnu-sed/libexec/gnubin:/opt/homebrew/opt/gnu-indent/libexec/gnubin:/opt/homebrew/opt/gawk/libexec/gnubin:/opt/homebrew/opt/findutils/libexec/gnubin:/opt/homebrew/opt/ed/libexec/gnubin:/opt/homebrew/opt/coreutils/libexec/gnubin:/opt/homebrew/opt/libpq/bin:${HOME}/.bin:${NVM_DIR}/versions/node/v18.18.0/bin:/opt/homebrew/bin:/opt/homebrew/sbin:${HOME}/.python/bin:/snap/bin:${HOME}/.bin:/usr/local/istio/bin:/opt/fluent-bit/bin:/usr/local/opt/coreutils/libexec/gnubin:/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:${HOME}/.antigen/bundles/robbyrussell/oh-my-zsh/lib:${HOME}/.antigen/bundles/robbyrussell/oh-my-zsh/plugins/aws:${HOME}/.antigen/bundles/robbyrussell/oh-my-zsh/plugins/brew:${HOME}/.antigen/bundles/robbyrussell/oh-my-zsh/plugins/git:${HOME}/.antigen/bundles/robbyrussell/oh-my-zsh/plugins/git-extras:${HOME}/.antigen/bundles/robbyrussell/oh-my-zsh/plugins/git-flow:${HOME}/.antigen/bundles/zsh-users/zsh-completions:${HOME}/.antigen/bundles/zsh-users/zsh-autosuggestions:${HOME}/.antigen/bundles/zsh-users/zsh-syntax-highlighting:${HOME}/.antigen/bundles/robbyrussell/oh-my-zsh/plugins/tmux:${HOME}/.antigen/bundles/chrissicool/zsh-256color
$PREFIX: ''
${NPM_CONFIG_PREFIX}: ''
$NVM_NODEJS_ORG_MIRROR: ''
^@$NVM_IOJS_ORG_MIRROR: ''
shell version: 'zsh 5.9 (x86_64-apple-darwin23.0)'
| uname -a: 'Darwin 23.6.0 Darwin Kernel Version 23.6.0: Mon Jul 29 21:14:30 PDT 2024; root:xnu-10063.141.2~1/RELEASE_ARM64_T6030 arm64 arm Darwin'
checksum binary: 'sha256sum'
OS version: macOS 14.6.1 23G93
awk: /opt/homebrew/opt/gawk/libexec/gnubin/awk, GNU Awk 5.3.1, API 4.0, (GNU MPFR 4.2.1, GNU MP 6.3.0)
curl: /usr/bin/curl, curl 8.7.1 (x86_64-apple-darwin23.0) libcurl/8.7.1 (SecureTransport) LibreSSL/3.3.6 zlib/1.2.12 nghttp2/1.61.0
wget: /opt/homebrew/bin/wget, GNU Wget 1.24.5 built on darwin23.2.0.
sed: /opt/homebrew/opt/gsed/libexec/gnubin/sed
cut: /opt/homebrew/opt/coreutils/libexec/gnubin/cut
basename: /opt/homebrew/opt/coreutils/libexec/gnubin/basename
rm: /opt/homebrew/opt/coreutils/libexec/gnubin/rm
mkdir: /opt/homebrew/opt/coreutils/libexec/gnubin/mkdir
xargs: /opt/homebrew/opt/findutils/libexec/gnubin/xargs
git: /usr/bin/git, git version 2.39.3 (Apple Git-146)
ls: cannot access 'grep:': No such file or directory
grep: grep: aliased to grep --color=auto --exclude-dir={.bzr,CVS,.git,.hg,.svn,.idea,.tox} (grep --color=auto --exclude-dir={.bzr,CVS,.git,.hg,.svn,.idea,.tox}), grep (GNU grep) 3.11
nvm current: v18.18.0
which node: ${NVM_DIR}/versions/node/v18.18.0/bin/node
which iojs: iojs not found
which npm: ${NVM_DIR}/versions/node/v18.18.0/bin/npm
npm config get prefix: ${NVM_DIR}/versions/node/v18.18.0
npm root -g: ${NVM_DIR}/versions/node/v18.18.0/lib/node_modules

nvm ls output:

       v14.21.3
       v15.14.0
       v18.16.1
->     v18.18.0
       v18.19.1
       v18.20.2
        v19.4.0
       v20.11.0
         system
default -> v18.18.0
iojs -> N/A (default)
unstable -> N/A (default)
node -> stable (-> v20.11.0) (default)
stable -> 20.11 (-> v20.11.0) (default)
lts/* -> lts/iron (-> N/A)
lts/argon -> v4.9.1 (-> N/A)
lts/boron -> v6.17.1 (-> N/A)
lts/carbon -> v8.17.0 (-> N/A)
lts/dubnium -> v10.24.1 (-> N/A)
lts/erbium -> v12.22.12 (-> N/A)
lts/fermium -> v14.21.3
lts/gallium -> v16.20.2 (-> N/A)
lts/hydrogen -> v18.20.4 (-> N/A)
lts/iron -> v20.17.0 (-> N/A)

How did you install nvm?

install script

What steps did you perform?

Change directory to a project that contains an invalid .nvmrc file and have the zsh integration enabled

# .nvmrc
engine-strict=true
19.4.0

What happened?

Switching to the directory containing a .nvmrc that has a key-value in it with the zsh integration active, displays an error

image

But running npx nvmrc validates the configuration.
Reordering the key-value in the .nvmrc file to come after the version fixes the issue. Also, without changing the .nvmrc file, disabling the zsh integration and explicitly executing nvm use in the directory causes no error.

What did you expect to happen?

Using the zsh integration to work the same as if I explicitly ran nvm use in the directory containing the nvmrc file.

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

I have changes in my PATH but the issue also occurs when performed in a clean codesandbox instance

@ljharb
Copy link
Member

ljharb commented Sep 24, 2024

fwiw engine-strict=true goes in .npmrc, and doesn't do anything in .nvmrc, but that doesn't change that there's some bug here.

@ljharb
Copy link
Member

ljharb commented Sep 25, 2024

on my mac, that nvmrc content works fine.

that suggests there's something going on with sed. the codesandbox is "locked" so i can't access it, but is there any chance that you're using any zsh global aliases, particularly one for sed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants