{"action":"created","issue":{"url":"https://api.github.com/repos/creationix/nvm/issues/721","labels_url":"https://api.github.com/repos/creationix/nvm/issues/721/labels{/name}","comments_url":"https://api.github.com/repos/creationix/nvm/issues/721/comments","events_url":"https://api.github.com/repos/creationix/nvm/issues/721/events","html_url":"https://github.com/creationix/nvm/issues/721","id":66996619,"number":721,"title":"0.24.1 fails when setting default version automatically?","user":{"login":"nicholascloud","id":513420,"avatar_url":"https://avatars.githubusercontent.com/u/513420?v=3","gravatar_id":"","url":"https://api.github.com/users/nicholascloud","html_url":"https://github.com/nicholascloud","followers_url":"https://api.github.com/users/nicholascloud/followers","following_url":"https://api.github.com/users/nicholascloud/following{/other_user}","gists_url":"https://api.github.com/users/nicholascloud/gists{/gist_id}","starred_url":"https://api.github.com/users/nicholascloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nicholascloud/subscriptions","organizations_url":"https://api.github.com/users/nicholascloud/orgs","repos_url":"https://api.github.com/users/nicholascloud/repos","events_url":"https://api.github.com/users/nicholascloud/events{/privacy}","received_events_url":"https://api.github.com/users/nicholascloud/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/creationix/nvm/labels/needs%20followup","name":"needs followup","color":"FA94FD"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-04-07T21:39:17Z","updated_at":"2015-04-08T10:26:03Z","closed_at":null,"body":"*NOTE* I'm still investigating this and it sounds like it might be an edge case, but I'm opening the issue now with the information I have in case others are experiencing this.\r\n\r\nWe use RightScale to deploy virtual servers. Today our instances, which all install nvm when launched, all started failing. We traced the audit output (shown below) to the nvm.sh script:\r\n\r\n```\r\n19:53:12: + echo 'installing node version manager...'\r\n19:53:12: + git clone https://github.com/creationix/nvm.git /opt/nvm\r\n19:53:12: installing node version manager...\r\n19:53:12: Cloning into '/opt/nvm'...\r\n19:53:12: + cd /opt/nvm\r\n19:53:12: ++ git describe --abbrev=0 --tags\r\n19:53:12: + git checkout v0.24.1\r\n19:53:12: Note: checking out 'v0.24.1'.\r\n\r\nYou are in 'detached HEAD' state. You can look around, make experimental\r\nchanges and commit them, and you can discard any commits you make in this\r\nstate without impacting any branches by performing another checkout.\r\n\r\nIf you want to create a new branch to retain commits you create, you may\r\ndo so (now or later) by using -b with the checkout command again. Example:\r\n\r\n  git checkout -b new_branch_name\r\n19:53:12: HEAD is now at c966204... v0.24.1\r\n19:53:12: + . /opt/nvm/nvm.sh\r\n++ NVM_SCRIPT_SOURCE=v0.24.1\r\n++ nvm_has unsetopt\r\n++ type unsetopt\r\n++ '[' -z '' ']'\r\n++ '[' -n /opt/nvm/nvm.sh ']'\r\n++ NVM_SCRIPT_SOURCE=/opt/nvm/nvm.sh\r\n19:53:12: ++++ dirname /opt/nvm/nvm.sh\r\n19:53:12: +++ cd /opt/nvm\r\n+++ pwd\r\n19:53:12: ++ export NVM_DIR=/opt/nvm\r\n++ NVM_DIR=/opt/nvm\r\n++ unset NVM_SCRIPT_SOURCE\r\n++ '[' -z '' ']'\r\n++ export NVM_NODEJS_ORG_MIRROR=https://nodejs.org/dist\r\n++ NVM_NODEJS_ORG_MIRROR=https://nodejs.org/dist\r\n++ '[' -z '' ']'\r\n++ export NVM_IOJS_ORG_MIRROR=https://iojs.org/dist\r\n++ NVM_IOJS_ORG_MIRROR=https://iojs.org/dist\r\n++ '[' -z '' ']'\r\n++ export NVM_IOJS_ORG_VERSION_LISTING=https://iojs.org/dist/index.tab\r\n++ NVM_IOJS_ORG_VERSION_LISTING=https://iojs.org/dist/index.tab\r\n19:53:12: +++ nvm_alias default\r\n19:53:12: ++ VERSION=\r\n19:53:12: Script exit status: 2\r\n```\r\n\r\nThe install script that generates this audit output looks like this (`E_NVM_DIR=/opt/nvm`):\r\n\r\n```bash\r\n#!/bin/bash -ex\r\n\r\n# install node version manager\r\necho \"installing node version manager...\"\r\ngit clone https://github.com/creationix/nvm.git $E_NVM_DIR\r\ncd $E_NVM_DIR\r\ngit checkout `git describe --abbrev=0 --tags`\r\n. $E_NVM_DIR/nvm.sh\r\n```\r\n\r\nWe changed the git checkout line to read:\r\n\r\n```bash\r\ngit checkout v0.24.0\r\n```\r\n\r\nand the images are all launching successfully now. So something in the v0.24.1 release, seemingly around automatic default version assignment, seems to be affecting our images. We are running Ubuntu 12.04.1 LTS with bash.\r\n"},"comment":{"url":"https://api.github.com/repos/creationix/nvm/issues/comments/90873087","html_url":"https://github.com/creationix/nvm/issues/721#issuecomment-90873087","issue_url":"https://api.github.com/repos/creationix/nvm/issues/721","id":90873087,"user":{"login":"ljharb","id":45469,"avatar_url":"https://avatars.githubusercontent.com/u/45469?v=3","gravatar_id":"","url":"https://api.github.com/users/ljharb","html_url":"https://github.com/ljharb","followers_url":"https://api.github.com/users/ljharb/followers","following_url":"https://api.github.com/users/ljharb/following{/other_user}","gists_url":"https://api.github.com/users/ljharb/gists{/gist_id}","starred_url":"https://api.github.com/users/ljharb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ljharb/subscriptions","organizations_url":"https://api.github.com/users/ljharb/orgs","repos_url":"https://api.github.com/users/ljharb/repos","events_url":"https://api.github.com/users/ljharb/events{/privacy}","received_events_url":"https://api.github.com/users/ljharb/received_events","type":"User","site_admin":false},"created_at":"2015-04-08T10:26:03Z","updated_at":"2015-04-08T10:26:03Z","body":"Yes, that's going to continue to be a problem. Running with `-e` is always problematic for this reason, and that makes your CI tests more brittle.\r\n\r\nYou could always `set -e` after `nvm` is loaded, if you need to."}}