Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Permission denied when trying to install the plugin #14

Closed
dmitriz opened this issue Dec 5, 2016 · 17 comments
Closed

Permission denied when trying to install the plugin #14

dmitriz opened this issue Dec 5, 2016 · 17 comments
Assignees

Comments

@dmitriz
Copy link

dmitriz commented Dec 5, 2016

Trying to follow the installation instructions
https://github.com/lukechilds/zsh-nvm#as-an-oh-my-zsh-custom-plugin
and added to .zshrc:

# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(git)
plugins+=(zsh-nvm)
...
source $ZSH/oh-my-zsh.sh
...

but still getting the error

source .zshrc   
Installing nvm...
fatal: could not create leading directories of '/Users/dmitrizaitsev/.nvm': Permission denied
_zsh_nvm_install:cd:3: no such file or directory: /Users/dmitrizaitsev/.nvm

Any help?

@lukechilds
Copy link
Owner

lukechilds commented Dec 6, 2016

Sorry traveling atm, so might not be that responsive.

Do you already have nvm installed?

@lukechilds lukechilds self-assigned this Dec 6, 2016
@dmitriz
Copy link
Author

dmitriz commented Dec 6, 2016

I have managed to install with homebrew.

@lukechilds
Copy link
Owner

Homebrew installation isn't officially supported by nvm.

Happy to help you get this resolved if you're still interested.

@dmitriz
Copy link
Author

dmitriz commented Dec 7, 2016

I surely would be interested what was the problem with the supported installation ;)

@lukechilds
Copy link
Owner

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?

@dmitriz
Copy link
Author

dmitriz commented Dec 9, 2016

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.

@lukechilds
Copy link
Owner

Hmmn, what OS and git version are you running?

@dmitriz
Copy link
Author

dmitriz commented Dec 9, 2016

Mac OSX 10.10.5 and git version 2.6.2

@lukechilds
Copy link
Owner

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?

@dmitriz
Copy link
Author

dmitriz commented Dec 9, 2016

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.

@lukechilds
Copy link
Owner

Do you currently have your brew install in ~/.nvm?

@dmitriz
Copy link
Author

dmitriz commented Dec 9, 2016

Yes, it worked with brew indeed, and ~/.nvm was created, no problem.

@lukechilds
Copy link
Owner

Ok, could you try adding:

export NVM_DIR="$HOME/.test-zsh-nvm"

to .zshrc before source $ZSH/oh-my-zsh.sh?

@dmitriz
Copy link
Author

dmitriz commented Dec 9, 2016

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.

@lukechilds
Copy link
Owner

lukechilds commented Dec 9, 2016

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.

@dmitriz
Copy link
Author

dmitriz commented Dec 9, 2016

I've moved away my .nvm and indeed that is working now. Strange...
Thanks in any case, for looking into it and your help!

@lukechilds
Copy link
Owner

No problem, seems like it was an issue with your environment rather than nvm, glad it's working now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants