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

arch -x86_64 nvm install lts/fermium returns arch: can't find nvm in PATH #2389

Open
hjoshi123 opened this issue Dec 23, 2020 · 4 comments
Open
Labels
needs followup We need some info or action from whoever filed this issue/PR. OS: Mac OS

Comments

@hjoshi123
Copy link
Contributor

Operating system and version:

Mac OS v11.1 Big Sur
Processor: M1

nvm debug output:

nvm --version: v0.37.2
$TERM_PROGRAM: iTerm.app
$SHELL: /bin/zsh
$SHLVL: 1
whoami: 'hemantjoshi'
${HOME}: /Users/hemantjoshi
${NVM_DIR}: '${HOME}/.nvm'
${PATH}: ${HOME}/.pyenv/shims:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/opt/openjdk/bin:${NVM_DIR}/versions/node/v15.4.0/bin:${NVM_DIR}/versions/node/v15.4.0/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/opt/go/libexec/bin
$PREFIX: ''
${NPM_CONFIG_PREFIX}: ''
$NVM_NODEJS_ORG_MIRROR: ''
$NVM_IOJS_ORG_MIRROR: ''
shell version: 'zsh 5.8 (x86_64-apple-darwin20.0)'
uname -a: 'Darwin 20.2.0 Darwin Kernel Version 20.2.0: Wed Dec 2 20:40:21 PST 2020; root:xnu-7195.60.75~1/RELEASE_ARM64_T8101 arm64'
checksum binary: 'shasum'
OS version: macOS 11.1 20C69
curl: /usr/bin/curl, curl 7.64.1 (x86_64-apple-darwin20.0) libcurl/7.64.1 (SecureTransport) LibreSSL/2.8.3 zlib/1.2.11 nghttp2/1.41.0
wget: not found
sed: /usr/bin/sed
cut: /usr/bin/cut
basename: /usr/bin/basename
rm: /bin/rm
mkdir: /bin/mkdir
xargs: /usr/bin/xargs
git: /usr/bin/git, git version 2.24.3 (Apple Git-128)
ls: 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 (BSD grep) 2.5.1-FreeBSD
awk: /usr/bin/awk, awk version 20200816
nvm current: v15.4.0
which node: ${NVM_DIR}/versions/node/v15.4.0/bin/node
which iojs: iojs not found
which npm: ${NVM_DIR}/versions/node/v15.4.0/bin/npm
npm config get prefix: ${NVM_DIR}/versions/node/v15.4.0
npm root -g: ${NVM_DIR}/versions/node/v15.4.0/lib/node_modules

nvm ls output:

      v14.15.3
->      v15.4.0
default -> node (-> v15.4.0)
iojs -> N/A (default)
unstable -> N/A (default)
node -> stable (-> v15.4.0) (default)
stable -> 15.4 (-> v15.4.0) (default)
lts/* -> lts/fermium (-> v14.15.3)
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 (-> N/A)
lts/fermium -> v14.15.3

How did you install nvm?

Install script in readme

What steps did you perform?

  1. Opened iTerm2 (natively)
  2. Ran arch -x86_64 nvm install lts/fermium to install latest lts.

What happened?

It returns arch: can't find nvm in PATH. This shouldnt happen as nvm is in the path. Somehow with the prefix of Rosetta it doesnt work. Even though if you open the iTerm in Rosetta and install it works.

What did you expect to happen?

nvm should take the prefix and install the node version under rosetta instead of restarting the terminal under Rosetta.

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

No

@ljharb
Copy link
Member

ljharb commented Dec 23, 2020

I think this may be a duplicate of #2350, somewhat. I don’t know how arch works, but presumably it doesn’t inherit the PATH from the invoking shell if that’s the error message you’re getting. If so there’s nothing nvm can really do about that.

@ljharb ljharb added needs followup We need some info or action from whoever filed this issue/PR. OS: Mac OS labels Dec 23, 2020
@hjoshi123
Copy link
Contributor Author

@ljharb I am not sure if problem of arch as this command arch -x86_64 pyenv --version is resolving properly. I am not sure what is the problem though as in why its not getting the path for nvm.

@ljharb
Copy link
Member

ljharb commented Dec 23, 2020

pyenv is a binary, nvm is a sourced shell function, so nvm.sh needs to be sourced to make it available.

@zemse
Copy link

zemse commented Feb 23, 2021

nvm is a sourced shell function, so nvm.sh needs to be sourced to make it available.

I tried doing arch -x86_64 source ~/.nvm/nvm.sh but it gives error "can't find source in PATH". Seems then it doesn't work

Finally what worked for me is duplicating Terminal app, selecting "Open using Rosetta" in get info and then running nvm commands through the duplicated terminal.

Edit: It's been a year, I ran into this problem now, found this thread on Google, and realized my own comment above just helped me lol.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs followup We need some info or action from whoever filed this issue/PR. OS: Mac OS
Projects
None yet
Development

No branches or pull requests

3 participants