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

Please fix the setup script for macOS #3558

Open
anton-bedrock opened this issue Apr 6, 2025 · 3 comments
Open

Please fix the setup script for macOS #3558

anton-bedrock opened this issue Apr 6, 2025 · 3 comments
Labels
installing nvm: profile detection Issues with nvm's own install script, related to figuring out the right profile file. shell: zsh

Comments

@anton-bedrock
Copy link

On macOS there setup script mentioned bash completions, but it should be zsh completions instead. An easy fix, but it will save hours for many macOS users. Please fix it.

After running the following command to install NVM.

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

my .zshrc file had the following added.

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion

After restarting the terminal, it appeared.

zsh compinit: insecure directories, run compaudit for list.
Ignore insecure directories and continue [y] or abort compinit [n]?

After changing bash_completion to zsh_completion, the error disappeared.

Originally posted by @amlzq in #2361

@ljharb
Copy link
Member

ljharb commented Apr 7, 2025

Not all Mac OS users use zsh, so it definitely shouldn’t do it by platform.

@ljharb ljharb added shell: zsh installing nvm: profile detection Issues with nvm's own install script, related to figuring out the right profile file. labels Apr 7, 2025
@anton-bedrock
Copy link
Author

anton-bedrock commented Apr 7, 2025

@ljharb said:

Not all Mac OS users use zsh, so it definitely shouldn’t do it by platform.

I think last 2-3 years macOS ships with zsh. So you always can check if zsh is available and use one output, with a fallback to bash. Seems an easy check

@ljharb
Copy link
Member

ljharb commented Apr 7, 2025

Yes, that's true, but if you've continuously migrated your Mac environment from prior to that, then you'll stay on bash, as I have.

zsh is always available now, that can't be used to make a choice.

I have a .bashrc, .bash_profile, and .zshrc present, but bash is my default. What logic would you suggest that can select "bash" for me but "zsh" for you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
installing nvm: profile detection Issues with nvm's own install script, related to figuring out the right profile file. shell: zsh
Projects
None yet
Development

No branches or pull requests

2 participants