{"action":"created","issue":{"url":"https://api.github.com/repos/Homebrew/homebrew/issues/43795","labels_url":"https://api.github.com/repos/Homebrew/homebrew/issues/43795/labels{/name}","comments_url":"https://api.github.com/repos/Homebrew/homebrew/issues/43795/comments","events_url":"https://api.github.com/repos/Homebrew/homebrew/issues/43795/events","html_url":"https://github.com/Homebrew/homebrew/issues/43795","id":105872794,"number":43795,"title":"nvm: copied nvm-exec doesn't work, etc","user":{"login":"apjanke","id":2618447,"avatar_url":"https://avatars.githubusercontent.com/u/2618447?v=3","gravatar_id":"","url":"https://api.github.com/users/apjanke","html_url":"https://github.com/apjanke","followers_url":"https://api.github.com/users/apjanke/followers","following_url":"https://api.github.com/users/apjanke/following{/other_user}","gists_url":"https://api.github.com/users/apjanke/gists{/gist_id}","starred_url":"https://api.github.com/users/apjanke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apjanke/subscriptions","organizations_url":"https://api.github.com/users/apjanke/orgs","repos_url":"https://api.github.com/users/apjanke/repos","events_url":"https://api.github.com/users/apjanke/events{/privacy}","received_events_url":"https://api.github.com/users/apjanke/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-09-10T18:45:13Z","updated_at":"2015-10-14T03:13:37Z","closed_at":"2015-09-28T14:47:39Z","body":"(A couple issues I ran in to with the `nvm` formula. I can do a PR for any/all of these if you're interested.)\r\n\r\nIn the caveats for `nvm`, it tells you to copy `nvm-exec` to your `~/.nvm` \"working directory\".\r\n\r\n```\r\nAdd NVM's working directory to your $HOME path (if it doesn't exist):\r\n\r\n  mkdir ~/.nvm\r\n\r\nCopy nvm-exec to NVM's working directory\r\n\r\n  cp $(brew --prefix nvm)/nvm-exec ~/.nvm/\r\n```\r\n\r\nThe copied `nvm-exec` doesn't work, at least under the current version of NVM. From what I can tell, `nvm-exec` expects to live in NVM's runtime/installation dir and have `nvm.sh` immediately next to it; not to be in the data/working `$NVM_DIR` directory.\r\n\r\n```\r\n[~]\r\n$ brew install nvm\r\nWarning: nvm-0.26.1 already installed\r\n[~]\r\n$ mkdir .nvm\r\n[~]\r\n$ cp $(brew --prefix nvm)/nvm-exec ~/.nvm/\r\n[~]\r\n$ export NVM_DIR=~/.nvm\r\n[~]\r\n$ source $(brew --prefix nvm)/nvm.sh\r\n[~]\r\n$ ~/.nvm/nvm-exec echo \"Hello world\"\r\n/Users/janke/.nvm/nvm-exec: line 5: /Users/janke/.nvm/nvm.sh: No such file or directory\r\n/Users/janke/.nvm/nvm-exec: line 10: nvm: command not found\r\nNo .nvmrc file found\r\nHello world\r\n[~]\r\n$\r\n```\r\n\r\nIt also seems like [downloading `nvm-exec` separately as a resource](https://github.com/Homebrew/homebrew/blob/0fc42ad603e6c52333896d37affdaedb10e46a8a/Library/Formula/nvm.rb#L15-L19) is redundant, since the NVM distribution contains `nvm-exec` (at least in the current version), and it's already mode `755`. (The `nvm-exec` stuff was added in 23e24979b7b1cb12124143cab017ecfa39b72155.)\r\n\r\nI'd like to remove the caveats about copying `nvm-exec`, and try doing the install without a separate `nvm-exec` resource. Anything I'm overlooking here?\r\n\r\n### Upgrades  ###\r\n\r\nIf the user doesn't set `$NVM_DIR` (which defaults to using the NVM installation directory as the data/working directory, too), will [NVM upgrades still lose their existing NVM-managed Node installs](https://github.com/creationix/nvm/issues/469#issuecomment-49404546)? Seems like yes, since `brew` is installing NVM to a versioned directory. Should we add a note about that in the caveats? Or do something about setting a different default `$NVM_DIR`? Otherwise, if users don't do the additional installation steps, it looks like things will seem to work fine, but then their Node installs will disappear some day when they do a `brew update; brew upgrade`.\r\n\r\n###  Misc   ###\r\n\r\nCouple other minor points on `nvm`:\r\n* The \"Add NVM's working directory to your $HOME path\" wording sounds odd to me; that sounds more like adding something to your path than creating a new directory under `$HOME`\r\n* The `nvm.sh` should probably be `chmod -x` since it is only intended for `source`-ing, and is useless if run as a standalone script/command.\r\n* Maybe we should add a note about the Homebrew formula being officially unsupported by NVM after all, and link it back to the [upstream discussion](https://github.com/creationix/nvm/issues/469). Seeing that would have helped me understand the current formula a bit better, and could help future maintainers. (As with #38537 – the \"not officially supported\" might be understood by default, but the link to that particular upstream discussion would be useful IMHO.)\r\n* Add a note about loading the `bash` completions to caveats, too? That requires an explicit user configuration change (`nvm.sh` doesn't do it for you), and it appears [misdocumented on the NVM repo](https://github.com/creationix/nvm#bash-completion). (It tells you to source it from the `$NVM_DIR` data/working dir, which only works if you're letting that default to the NVM runtime installation directory, which Homebrew does not do if you've followed the instructions in the caveats. And Homebrew relocates NVM's `bash_completion` anyway, so it needs custom instructions.)"},"comment":{"url":"https://api.github.com/repos/Homebrew/homebrew/issues/comments/147914884","html_url":"https://github.com/Homebrew/homebrew/issues/43795#issuecomment-147914884","issue_url":"https://api.github.com/repos/Homebrew/homebrew/issues/43795","id":147914884,"user":{"login":"apjanke","id":2618447,"avatar_url":"https://avatars.githubusercontent.com/u/2618447?v=3","gravatar_id":"","url":"https://api.github.com/users/apjanke","html_url":"https://github.com/apjanke","followers_url":"https://api.github.com/users/apjanke/followers","following_url":"https://api.github.com/users/apjanke/following{/other_user}","gists_url":"https://api.github.com/users/apjanke/gists{/gist_id}","starred_url":"https://api.github.com/users/apjanke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apjanke/subscriptions","organizations_url":"https://api.github.com/users/apjanke/orgs","repos_url":"https://api.github.com/users/apjanke/repos","events_url":"https://api.github.com/users/apjanke/events{/privacy}","received_events_url":"https://api.github.com/users/apjanke/received_events","type":"User","site_admin":false},"created_at":"2015-10-14T03:13:37Z","updated_at":"2015-10-14T03:13:37Z","body":"Looks like the caveats automatically contain a note about bash completion when displayed after it has been installed. That seems sufficient.\r\n\r\n```\r\n==> Caveats\r\n\r\nBash completion has been installed to:\r\n  /usr/local/etc/bash_completion.d\r\n```\r\n"}}