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

Feature Request: nvm binary #3257

Open
svarlitskiy opened this issue Dec 29, 2023 · 4 comments
Open

Feature Request: nvm binary #3257

svarlitskiy opened this issue Dec 29, 2023 · 4 comments
Labels
feature requests I want a new feature in nvm!

Comments

@svarlitskiy
Copy link

Feature Request: nvm binary

  1. Allow install script to install to global directory /usr/share/nvm
  2. Create a shell script that runs the nvm command like an executable /usr/bin/nvm
#!/bin/bash

export NVM_DIR="/usr/share/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

nvm $@
@ksh5a

This comment was marked as spam.

@ljharb
Copy link
Member

ljharb commented Dec 29, 2023

nvm is per-user, so it should never be installed globally. We already have nvm-exec that can be run as a binary, as well.

@ljharb ljharb added the feature requests I want a new feature in nvm! label Dec 29, 2023
@srk24
Copy link

srk24 commented Feb 6, 2024

i build docker images, but cannt use it in jenkins docker pipline.
so binary is importent to me.

mcdurdin added a commit to keymanapp/keyman that referenced this issue Jul 31, 2024
On Linux, macOS, nvm is only provided as a bash function, which means it
is not available to the script unless nvm.sh is `source`d.
Unfortunately, this is fragile -- variable usage, function names, etc.
can all interfere with each other between build.sh and nvm.sh (for
example, the `$VERSION` variable).

So we have a wrapper script on those platforms to do our nvm invocation.

Relates-to: nvm-sh/nvm#3257
@Burnsedia
Copy link

could this be a app image or a snap on linux? If so I can create a github action that bundles it as one

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!
Projects
None yet
Development

No branches or pull requests

5 participants