Nvm: warning: Could not find remote branch v0.35.3 to clone.

Created on 27 Mar 2020  路  18Comments  路  Source: nvm-sh/nvm

I have been trying to install nvm using both the curl and install.sh scripts on OS X High Sierra (10.13.6) and I keep getting the message:

warning: Could not find remote branch v0.35.3 to clone. fatal: Remote branch v0.35.3 not found in upstream origin Failed to clone nvm repo. Please report this!

installing nvm non-issue / invalid

Most helpful comment

@ljharb - No. It's installed. Thanks. Sorry for the bother.

All 18 comments

What version of git are you using? nvm requires v1.7.10 (see the note just above https://github.com/nvm-sh/nvm#git-install)

What version of git are you using? nvm requires v1.7.10 (see the note just above https://github.com/nvm-sh/nvm#git-install)

git version 2.17.2 (Apple Git-113)

The tag is right here: https://github.com/nvm-sh/nvm/tree/v0.35.3 so I鈥檓 not sure how it鈥檇 be unable to find it. The error comes from here: https://github.com/nvm-sh/nvm/blob/258938ef66a2a49a4a400554a6dce890226ae34c/install.sh#L122

What happens if you try to git clone this repo directly?

I was able to clone it with git clone https://github.com/nvm-sh/nvm.git successfully.

The tag is right here: https://github.com/nvm-sh/nvm/tree/v0.35.3 so I鈥檓 not sure how it鈥檇 be unable to find it. The error comes from here:

https://github.com/nvm-sh/nvm/blob/258938ef66a2a49a4a400554a6dce890226ae34c/install.sh#L122

What happens if you try to git clone this repo directly?

I was able to clone it with git clone https://github.com/nvm-sh/nvm.git successfully.
I have an nvm directory, but not nvm itself (as far as I can see).

I also tried curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.32.1/install.sh | bash as discussed at https://www.codementor.io/@mercurial/how-to-install-node-js-on-macos-sierra-mphz41ekk and it cloned to the ~/.nvm directory, but did NOT create a nvm.sh file.

"nvm itself" is the repo's nvm.sh file, which is part of the clone. (also, v0.32.1 is old, you want v0.35.3).

Perhaps you need to rm -rf ~/.nvm and try reinstalling nvm again?

@ljharb - After figuring out how to authenticate to github, I tried curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.35.3/install.sh | bash

That file, install.sh, does exist.

I got the message:

warning: Could not find remote branch v0.35.3 to clone. fatal: Remote branch v0.35.3 not found in upstream origin Failed to clone nvm repo. Please report this!

I then tried the formal command from the nvm page: curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash

Same message.

https://raw.githubusercontent.com/creationix/nvm/v0.35.3/install.sh definitely exists; you can visit it by clicking the link.

I鈥檓 mystified how you would get this error :-/ in the separately cloned git repo, what does git tag print out?

I just ran curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.32.1/install.sh | bash and it ran, but during its running there was the message:

error: pathspec 'v0.32.1' did not match any file(s) known to git.

And then:

=> Appending source string to /Users/xxxx/.bash_profile bash: line 315: /Users/xxxx/.nvm/nvm.sh: No such file or directory

When it finishes, there is no ~/.nvm/nvm.sh file. Running git tag in that directory gives me:

POST-MIGRATE-CONFIG PRE-CONFIG-MIGRATE

https://raw.githubusercontent.com/creationix/nvm/v0.32.1/install.sh works too; the error you鈥檙e seeing is from the tags failing to load.

What does git remote -v print out?

For creationix, just:

origin https://github.com/creationix/nvm.git (push)

No fetch. There are also two origin listings for work sites, a push and a fetch.

you鈥檙e inside the nvm git repo, why do you have remotes for your work? Is perhaps your home dir a git repo? If so, that鈥檚 the problem :-)

Also, without a fetch remote, you won鈥檛 be able to read anything from the repo, which is why you鈥檙e not seeing tags.

Another alternative is that you have your work remotes in your global git config, which would also break git usage for any other repo.

I think the problem is that I command line set up global push and fetch origins for my work stuff.

Yes, that breaks git for any other repo. If you fix that, then nvm will work fine.

@ljharb - I edited my global git config file and ran curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash

Everything seems to have installed. The remote called returned:

origin  https://github.com/nvm-sh/nvm.git (fetch)
origin  https://github.com/nvm-sh/nvm.git (push)

Both git tag and nvm --version return v0.35.3. Its showing as (no branch).

Perfect, it's a tag, so that's all correct.

If you reopen your terminal, nvm should be installed. Happy to reopen if not.

@ljharb - No. It's installed. Thanks. Sorry for the bother.

Was this page helpful?
0 / 5 - 0 ratings