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

How do I nvm install from a noninteractive shell? #2385

Open
Kreijstal opened this issue Dec 17, 2020 · 3 comments
Open

How do I nvm install from a noninteractive shell? #2385

Kreijstal opened this issue Dec 17, 2020 · 3 comments

Comments

@Kreijstal
Copy link

I'm trying to use nvm from another language, so when it calls bash, it doesn't execute .bashrc, and sessions are as long as only 1 command, so it doesn't save any enviromental variables, how hard is to execute nvm install in this situation?

@ljharb
Copy link
Member

ljharb commented Dec 17, 2020

That it's an interactive shell only determines which profile files are sourced - you can choose to source nvm.sh in any shell, either manually or via the correct profile file.

If your sessions are only as long as one command, you'd probably do something like . /path/to/nvm.sh && nvm install node - but since nvm sets the $PATH so that you can use node, all your node/npm commands would have to run inside that same shell session.

@Kreijstal
Copy link
Author

image
Guess it doesn't work for me

@ljharb
Copy link
Member

ljharb commented Dec 17, 2020

the command is . not bash

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants