Closed dmitriz closed 7 years ago
Sorry traveling atm, so might not be that responsive.
Do you already have nvm
installed?
I have managed to install with homebrew.
Homebrew installation isn't officially supported by nvm.
Happy to help you get this resolved if you're still interested.
I surely would be interested what was the problem with the supported installation ;)
It appears to be an issue with git
not having permission to create the /Users/dmitrizaitsev/.nvm
folder to clone nvm
into. Weird question but did the session you ran source .zshrc
from definitely have write access to your home folder?
I suppose it does.
E.g. when I put mkdir ~/.test
inside .zshrc
and execute source .zshrc
, the directory .test
is created with no problems.
Only with plugins+=(zsh-nvm)
I can see that problem,
now that the directory is created, here are the error messages:
source .zshrc
Installing nvm...
fatal: destination path '/Users/zaitsev/.nvm' already exists and is not an empty directory.
fatal: 'origin' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
error: pathspec '' did not match any file(s) known to git.
Hmmn, what OS and git
version are you running?
Mac OSX 10.10.5 and git version 2.6.2
I don't seem to be able to recreate the issue, the only way I can get the same error as you is if I try and clone into a folder I don't have write access to.
What happens if you run: git clone https://github.com/creationix/nvm.git ~/.test-nvm
?
No problem:
git clone https://github.com/creationix/nvm.git ~/.test-nvm
Cloning into '/Users/zaitsev/.test-nvm'...
remote: Counting objects: 6025, done.
remote: Compressing objects: 100% (13/13), done.
remote: Total 6025 (delta 5), reused 0 (delta 0), pack-reused 6012
Receiving objects: 100% (6025/6025), 1.71 MiB | 247.00 KiB/s, done.
Resolving deltas: 100% (3751/3751), done.
Checking connectivity... done.
Do you currently have your brew install in ~/.nvm
?
Yes, it worked with brew
indeed, and ~/.nvm
was created, no problem.
Ok, could you try adding:
export NVM_DIR="$HOME/.test-zsh-nvm"
to .zshrc
before source $ZSH/oh-my-zsh.sh
?
Working ;)
source ~/.zshrc
Installing nvm...
Cloning into '/Users/zaitsev/.test-zsh-nvm'...
remote: Counting objects: 6025, done.
remote: Compressing objects: 100% (13/13), done.
remote: Total 6025 (delta 5), reused 0 (delta 0), pack-reused 6012
Receiving objects: 100% (6025/6025), 1.71 MiB | 1.35 MiB/s, done.
Resolving deltas: 100% (3751/3751), done.
Checking connectivity... done.
Hmmmn, that shouldn't be any different to the original install (other than the folder), NVM_DIR
will default to "$HOME/.nvm"
if it's not set.
If you delete that line from .zshrc
and brew uninstall node
(make sure that removes ~/.nvm) it should work.
Just re-source ~/.zshrc
and it should install into ~/.nvm
.
I've moved away my .nvm
and indeed that is working now. Strange...
Thanks in any case, for looking into it and your help!
No problem, seems like it was an issue with your environment rather than nvm
, glad it's working now.
Trying to follow the installation instructions https://github.com/lukechilds/zsh-nvm#as-an-oh-my-zsh-custom-plugin and added to
.zshrc
:but still getting the error
Any help?