-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
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
Documenting how to install NVM for all users #1533
Comments
nvm is not intended to be global or system-wide - it's per-user, per-shell-session. Thus, each user account must have its own I would not want to document anything in the readme that encourages people to use nvm across user accounts - there's other tools for that. |
There is of course n (with n-install) which with a coaching could do the same. I'll give that a shot and create a gist of the process, what are the possible other tools, other than say apt-get, brew or some system level package manager which you are usable to manager the version of node in your shell? |
Yes, However, I'd suggest just installing |
Yes it is always good to go with what nvm is intended for. per user. Go for per user installation. I have a similar kind of a situation (I used to install node without nvm previously) and did the same. |
You know, for an util that should eliminate version discrepancies and staff it sure does increase it a lot... I mean I have server that deploys web projects on git pushes via hooks (i.e user = git). But sometimes I need to log in and redeploy the same things manually by invoking the git hooks manually (user = me). And sometimes my colleagues have to do the same (user = foo)... And then there is a process manager (PM2) that should be central for everyone, but it relies on node as well... And everybody have it's own node&npm. Except root, so trying to sudo yields even less results, i.e |
Yes - the hazard is "multiuser usage". In your use case, everyone should be running |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Hey guys, For anyone else, please use the proper user-scoped approach. Whatever floats your servers chaps. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Please see #1533 (comment) if you have any questions - This issue remains open because there's clearly some documentation change that could be made in the readme to make this more clear. A PR to do so is welcome. |
I needed a global install of NVM because I have some node based cron jobs and a few legacy applications that are rather picky about which version of node they are able to work on. For a time I worked around this by sourcing the nvm script everywhere but that seems to be a somewhat unmaintainable solution.
The requirements I have:
$ nvm exec
)This is the solution I came up with: (shout out to @icecoldPHP, for the initial version)
# groupadd nvm
# usermod -aG nvm root
/opt
directory and create a directory called nvm# chown :nvm ./nvm
# chmod g+ws ./nvm
/opt/nvm
as the directory/etc/profile.d/nvm.sh
:# chmod +x /etc/profile.d/nvm.sh
/etc/bash.bashrc
before the line saying# If not running interactively, don't do anything
by adding. /etc/profile.d/nvm.sh
.[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
after the section about bash completion.Every user can select a version of node (as the permissions for public are
r-x
) and users in the nvm group can install and remove versions of node (permissions for the group arerwx
).My questions are:
The text was updated successfully, but these errors were encountered: