nvm: objc "Class AMSupportURL... is implemented in both... One of the two will be used. Which one is undefined." messages when loading nvm in .zshrc on M1 Mac with Xcode installed

Operating system and version: macOS 12.1

nvm debug output:

nvm --version: v0.39.1
$TERM_PROGRAM: iTerm.app
$SHELL: /bin/zsh
$SHLVL: 1
whoami: 'xxxxxx'
${HOME}: /Users/xxxxxx
${NVM_DIR}: '${HOME}/.nvm'
${PATH}: ${NVM_DIR}/versions/node/v14.17.5/bin:/opt/homebrew/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/bin:/opt/homebrew/opt/mysql-client/bin:/opt/homebrew/opt/findutils/libexec/gnubin:/opt/homebrew/opt/coreutils/libexec/gnubin:/opt/homebrew/bin:/usr/bin:/bin:/usr/sbin:/sbin:${HOME}/.krew/bin
$PREFIX: ''
${NPM_CONFIG_PREFIX}: ''
$NVM_NODEJS_ORG_MIRROR: ''
$NVM_IOJS_ORG_MIRROR: ''
shell version: 'zsh 5.8 (x86_64-apple-darwin21.0)'
uname -a: 'Darwin 21.2.0 Darwin Kernel Version 21.2.0: Sun Nov 28 20:28:41 PST 2021; root:xnu-8019.61.5~1/RELEASE_ARM64_T6000 arm64 arm64 MacBookPro18,3 Darwin'
checksum binary: 'sha256sum'
OS version: macOS 12.1 21C52
curl: /usr/bin/curl, curl 7.77.0 (x86_64-apple-darwin21.0) libcurl/7.77.0 (SecureTransport) LibreSSL/2.8.3 zlib/1.2.11 nghttp2/1.42.0
wget: not found
sed: /usr/bin/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
ls: cannot access 'git:': No such file or directory
git: git: aliased to /opt/homebrew/bin/git (/opt/homebrew/bin/git), git version 2.34.1
grep: /usr/bin/grep, grep (BSD grep, GNU compatible) 2.6.0-FreeBSD
awk: /usr/bin/awk, awk version 20200816
nvm current: v14.17.5
which node: ${NVM_DIR}/versions/node/v14.17.5/bin/node
which iojs: iojs not found
which npm: ${NVM_DIR}/versions/node/v14.17.5/bin/npm
npm config get prefix: ${NVM_DIR}/versions/node/v14.17.5
npm root -g: ${NVM_DIR}/versions/node/v14.17.5/lib/node_modules

nvm ls output:

->     v14.17.5
       v16.13.0
       v16.13.2
         system
default -> 14.17.5 (-> v14.17.5)
iojs -> N/A (default)
unstable -> N/A (default)
node -> stable (-> v16.13.2) (default)
stable -> 16.13 (-> v16.13.2) (default)
lts/* -> lts/gallium (-> v16.13.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.24.1 (-> N/A)
lts/erbium -> v12.22.9 (-> N/A)
lts/fermium -> v14.18.3 (-> N/A)
lts/gallium -> v16.13.2

How did you install nvm?

Website (may have used homebrew on a previous machine so remnants of that may exist in my config)

What steps did you perform?

I’ve included the following in my ~/.zshrc:

export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm

What happened?

Each time I restart macOS and launch iTerm2, the following warnings appear:

objc[2613]: Class AMSupportURLConnectionDelegate is implemented in both /usr/lib/libauthinstall.dylib (0x21143eb90) and /Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x1080c42c8). One of the two will be used. Which one is undefined.
objc[2613]: Class AMSupportURLSession is implemented in both /usr/lib/libauthinstall.dylib (0x21143ebe0) and /Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x1080c4318). One of the two will be used. Which one is undefined.
objc[3501]: Class AMSupportURLConnectionDelegate is implemented in both /usr/lib/libauthinstall.dylib (0x21143eb90) and /Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x105e182c8). One of the two will be used. Which one is undefined.
objc[3501]: Class AMSupportURLSession is implemented in both /usr/lib/libauthinstall.dylib (0x21143ebe0) and /Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x105e18318). One of the two will be used. Which one is undefined.

This only happens when I first launch iTerm2 after a macOS restart. It does not happen during subsequent quitting/relaunching of iTerm2 - only after the next time I restart macOS and launch iTerm2.

I tried restarting my computer, removing both lines from my ~/.zshrc, then just executing them in a new shell session to see if the same behavior occurs, but it does not - the warnings do not come up. They only come up when iTerm2 is launching and executing the lines in my ~/.zshrc.

What did you expect to happen?

I am using Powerlevel10k’s instant prompt feature and it reports Console output during zsh initialization like this. I can easily suppress the output, but instead I’d rather figure out why it’s happening and have it not happen. Simply suppressing warnings/errors from the nvm initialization now might prevent me from seeing other important notices in the future.

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

Yes. See resulting ${PATH} variable value in nvm debug output above.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 2
  • Comments: 17 (7 by maintainers)

Most upvoted comments

@a1031 it’s good to understand that’s the cause, but it’s still not ideal, since having Xcode installed is necessary for anyone doing iOS development. I’d love to figure out if there’s a better solution.

Can confirm that the issue is directly related to xcode. I had nvm and homebrew installed on my mac yesterday and was not getting this error. Just installed xcode to do some IOS development and the error appeared. I have installed the latest xcode directly from the app store, 13.2.1, and have node version 16 installed with nvm.

@ljharb By the time xcode had finished installing (and when I saw this message pop up) I had only installed wget and go. It could very well be a core homebrew issue, or something to do with the dependencies that wget requires perhaps? I don’t believe go has any other homebrew dependencies

Edit: I’ll spin up a fresh macOS VM and give it a go

Same things happens here: new laptop, new macOS (12.2)… Only XCode was installed before nvm

I then installed node 16 nvm install 16… and that’s it!

And now on FIRST terminal opening I have this message, but not when I open another terminal after that (even after quit the Terminal.app)… I think I saw it also during nvm install but I didn’t really pay attention…

objc[824]: Class AMSupportURLConnectionDelegate is implemented in both /usr/lib/libamsupport.dylib (0x1e2c23678) and /Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x103cf42c8). One of the two will be used. Which one is undefined. objc[824]: Class AMSupportURLSession is implemented in both /usr/lib/libamsupport.dylib (0x1e2c236c8) and /Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x103cf4318). One of the two will be used. Which one is undefined. objc[830]: Class AMSupportURLConnectionDelegate is implemented in both /usr/lib/libamsupport.dylib (0x1e2c23678) and /Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x105e782c8). One of the two will be used. Which one is undefined. objc[830]: Class AMSupportURLSession is implemented in both /usr/lib/libamsupport.dylib (0x1e2c236c8) and /Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x105e78318). One of the two will be used. Which one is undefined.

As it’s said in the README, I installed the XCode Command line tools manually (xcode-select --install) and created the .zshrc by doing: touch ~/.zshrc

As it’s a brand new system, I don’t think it’s due to homebrew packages… maybe a conflict in XCode? I could try to reset the computer and try again without XCode…

The one available today in the Mac App Store: 13.2.1

On 8 Feb 2022, at 16:42, Jordan Harband @.***> wrote:

Which version of Xcode? 13?

— Reply to this email directly, view it on GitHub https://github.com/nvm-sh/nvm/issues/2720#issuecomment-1032750325, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADTX57Q4YIQJ66MGXENSODTU2E2X5ANCNFSM5MNYWSJQ. You are receiving this because you commented.

Ok, I’ve done some more troubleshooting on this and found that it also happens in Terminal.app (so it’s not specific to iTerm2) and I was wrong about it only happening in zsh startup - I can actually cause it to happen after startup by removing [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" from my ~/.zshrc and running it manually.

Given my installed node versions:

❯ nvm list
->     v14.17.5
       v16.13.2
         system
default -> 14.17.5 (-> N/A)

I thought maybe it was related to v14.17.5being my default version, and that node did not ship arm64-compatible binaries before v16.0.0 (saw this note in the nvm README about this). But the warnings still come up after uninstalling 14 (or using nvm alias default node to set the default to 16).

I’ve also tried temporarily removing the homebrew-installed binaries mentioned (basename, cut, mkdir, rm, and xargs) from /opt/homebrew/opt/coreutils/libexec/gnubin/ but that did not resolve the issue.

I will continue to troubleshoot this when I have time.