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

Option on install to not add path to .profile #2076

Open
muuvmuuv opened this issue Jul 12, 2019 · 8 comments · May be fixed by #2467
Open

Option on install to not add path to .profile #2076

muuvmuuv opened this issue Jul 12, 2019 · 8 comments · May be fixed by #2467
Labels
feature requests I want a new feature in nvm! installing nvm Problems installing nvm itself

Comments

@muuvmuuv
Copy link

Is it possible to prevent the install-script to not add NVM to path in my e.g. ~/.profile? I use a zsh prezto plugin (node) which already does this.

@ljharb
Copy link
Member

ljharb commented Jul 12, 2019

that already does what, invokes nvm? all the install script’s added line does is sources nvm.sh, which auto-uses the default if you have one set.

@muuvmuuv
Copy link
Author

Yes it sources it.

ATM when I run the install script via curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash it adds this to my .zshrc:

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

I just would like to have an option to prevent that.

@ljharb
Copy link
Member

ljharb commented Jul 15, 2019

why? that’s needed for nvm to work.

@ljharb
Copy link
Member

ljharb commented Jul 15, 2019

Specifically I don’t know what a prezto plugin is or how it works, so perhaps explaining that would help me understand the conflict?

@muuvmuuv
Copy link
Author

Prezto is a zsh framework like oh-my-zsh. Sorry my bad, I forgot that not everyone knew what it is.

Yes but the Prezto plugin already loads NVM, that is what I mean, so it is not needed to add it twice. The bash_completion is done by another plugin. Here is its content: https://github.com/sorin-ionescu/prezto/blob/master/modules/node/init.zsh

@ljharb
Copy link
Member

ljharb commented Jul 16, 2019

It should be checking if the nvm function exists before sourcing nvm.sh; but i also don't understand why it makes sense for prezto to source nvm when nvm does it for you.

Either way, the install script basically only downloads $NVM_DIR, preferably with git, and then adds those lines - so if you only want nvm to exist on your system, you can always just git clone the latest tagged release.

@muuvmuuv
Copy link
Author

Makes sense. I will also open an issue on their end to address this. I think the purpose was to keep the zshrc (or whatever) clean and let the plugin handle it.

Will do it the manual way, thank you!

@ljharb
Copy link
Member

ljharb commented Jul 16, 2019

I'll leave this open; it's not an unreasonable request :-) it's just added complexity for what might be a very niche use case.

@ljharb ljharb added feature requests I want a new feature in nvm! installing nvm Problems installing nvm itself labels Jul 16, 2019
matt-tingen added a commit to matt-tingen/configs that referenced this issue Mar 8, 2020
The primary motivation here is that the main nvm install script has no
option for skipping profile editing
(nvm-sh/nvm#2076) and I want to keep `.zshrc`
clean.
matt-tingen added a commit to matt-tingen/configs that referenced this issue Mar 8, 2020
The primary motivation here is that the main nvm install script has no
option for skipping profile editing
(nvm-sh/nvm#2076) and I want to keep `.zshrc`
clean.
@sladyn98 sladyn98 linked a pull request Mar 18, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature requests I want a new feature in nvm! installing nvm Problems installing nvm itself
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants