-
-
Notifications
You must be signed in to change notification settings - Fork 8.1k
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
Slow terminal startup running xcodebuild if not using system node #2747
Comments
nvm is explicitly unsupported when installed with homebrew; what happens when you install it with the supported method? Separately, do you have the xcode command line tools installed? That's always the first step on any Mac - run |
I see this may at some level be an argument between nvm and homebrew. In which case, really, you just need to make nvm work with homebrew. Brewfile installs etc are standard facts on the developer landscape that you can't wish away, and you are 1000x smaller than homebrew. But even so, I did: % brew remove nvm
% rm -rf ~/.nvm
% brew remove zsh and removed all your lines from I got Then I did your Installed the latest lts node in nvm, aliased default to it, and rebooted the machine. => SAME PROBLEM. I tried some incantations in this thread that may be a related issue between homebrew, zsh, and nvm pointed to in your readme. They also did not work for me, if anything making the lag worse. I am happy to try your ideas. Btw I'm running on an Intel i9 iMac, not Apple Silicon. |
(note, i'm not saying to not use brew, i'm saying to only install software from official distribution channels - and nvm is not officially distributed on homebrew, nor will it ever be) ok, thanks for clarifying, including that it's not an M1 mac. presumably, even without the lines in zshrc, you can reproduce this slowness just by manually sourcing nvm.sh? if so, can you |
OK I commented out the nvm.sh line from my zshrc and rebooted and did as you directed. Interestingly, the place it hangs is on the So perhaps there is some
|
(you can |
You might not be giving me enough directions. I just get an echo back of a path:
If I just run
This however is with |
oh hm, maybe If the slowness is only when you have a default alias set, then that's a known issue that sometimes happens for zsh users. You can That said, that it's related to "xcodebuild" is a new one, so I'd love to figure out what's invoking that. |
OK I did
Rebooted, everything worked fine and fast, until I
Which is still slow and even beachballs Chrome for like a minute which I had to wait for to file this reply. So nothing to do with default being set, which btw is a very useful feature in general and would be annoying to have to lose. |
It's bizarre that it would affect Chrome, since Chrome isn't a shell program. My suspicion is that there's something unique about your setup - maybe you have a large manpath, or a ton of homebrew tools installed, or something? Literally the only thing |
Can I defeat the manpath change? Because I'm 99% sure that is what's doing it. My system isn't extraordinary for a dev machine. |
You can make sure |
OK! So it appears adding this line to ~/.zshrc above the nvm lines works around the problem for now: alias manpath=false I believe the Chrome beachball I was getting was because I had the devtools up which probably use a shell environment. Of course, nvm users are quite likely to have Chrome devtools running. Obviously this is an ugly workaround and needs to be addressed in the default configuration as again, many others have run into this problem before me. Thanks for your help in finding this workaround. Update: OK disregard the Chrome report that is probably something else. Anyway my terminals launch fast now with default to stable, thanks. |
Dev tools definitely don’t have any shell environment, but I’m glad you found a workaround. |
The "disable manpath" workaround works in my case as well (mac mini intel i5). Is the root cause identified and fixable? |
@beenotung not yet identified, and thus not yet fixable. If you change your default shell to "not zsh", do you still see this problem? I'm wondering if it's some kind of zsh-specific manpath-related bug. |
I'm running GNU bash, version 5.2.26 as my default and had the exact same issue. |
Operating system and version:
Latest Mac OS Monterey 12.2.1, but I've seen this on earlier OS versions too.
nvm debug
output:How did you install
nvm
?Homebrew
What steps did you perform?
nvm alias default stable
or, if starting terminal with nvm default set to system,
nvm use stable
What happened?
Every time I start the terminal for the first time after an OS reboot, or set nvm to use the non-system version of node for the first time, the terminal freezes for a minute with
xcodebuild
shown in its title bar. This actually slows down many aspects of my computer, including Chrome browser. It's a well-known problem: see here or here for examples of others reporting this. But I found no github issue on it so I posted this one.The workaround is to use
nvm alias default system
and only usenvm use stable
(or whichever other version is desired) when needed, though this will also run xcodebuild for a seeming eternity the first time you do it. I did other workaround ideas such asbrew install git
,brew install zsh
,sudo xcodebuild -license accept
, and none got rid of this serious lag.What did you expect to happen?
Should run promptly every startup, as the system version does.
Is there anything in any of your profile files that modifies the
PATH
?No
The text was updated successfully, but these errors were encountered: