nvm
nvm copied to clipboard
Allow global installation of NVM with individual user .nvm directories for Node installs
This PR is a clone of #1845; updated and rebased onto the current master and into a repo not tied to an unrelated project.
The goal is to provide a central install of NVM that permits users to have their own $NVM_DIR where Node installs live but have NVM's core files live elsewhere. It is still required that a user's $NVM_DIR be a directory where the current user has full access.
I'm actively using a setup like this throughout the infrastructure I manage and am testing this specific change on a CI server I control. NVM, while not intending to be multi-user, actually works quite well outside of nvm exec, which this PR resolves.
I've made a few modifications from the original PR. Namely:
- Simpler
DIRdetermination innvm-exec - Applied a change recommended by @ljharb on the original PR
- Removed the
tarflag changes since specific flag applied appears to be the default for alltars I'm aware of and doesn't exist on OpenBSD'star, as far as I could tell.
With the changes to the main nvm script, I've noticed that it's not even required to have nvm-exec symlinked into $NVM_DIR when executed as nvm exec. This change could also allow for nvm-exec exec to be symlinked into a standard location for binaries (e.g. /usr/local/bin) to provide nvm-exec easily to system processes, though I haven't tested this personally.
@chall8908 please don't open duplicate PRs - instead post a link to the branch on the original one and I can update it. Now I have to keep both PRs in sync :-/
@ljharb I wasn't aware that was an option. I'll happily close this PR so you can update the other.
Please don't; once opened a PR ref can never be deleted, so i'd rather keep them in sync.
Feel free to keep updating this one to get tests passing.
The failing Travis tests appear to be Python errors from the Node source itself. The errors all appear to be things expecting Python 2 and getting Python 3.
I noticed that the past few test runs have all failed on these tests with the same errors from the few I spot checked. I'm wondering now if this isn't something that changed inside Travis somehow. Thoughts?
oof, if so i'll have to take that up with travis. thanks, i'll investigate.