nvm icon indicating copy to clipboard operation
nvm copied to clipboard

Failed to clone nvm repo. Installation on Cygwin Bash

Open Lamera opened this issue 2 years ago • 7 comments

Operating system and version: Windows 11 22H2 (Cygwin)

How did you install nvm?

Tried to install it in a cygwin bash shell.

What steps did you perform?

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash

What happened?

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 15916  100 15916    0     0   244k      0 --:--:-- --:--:-- --:--:--  246k
=> Downloading nvm from git to '/home/joel/.nvm'
=> Cloning into '/home/joel/.nvm'...
fatal: cannot copy 'C:/Program Files/Git/mingw64/share/git-core/templates/description' to 'C:/home/joel/.nvm/.git/description': Permission denied
Failed to clone nvm repo. Please report this!

What did you expect to happen?

That the correct windows filepaths are getting used on cygwin.

Lamera avatar May 30 '23 16:05 Lamera

fatal: cannot copy 'C:/Program Files/Git/mingw64/share/git-core/templates/description' to 'C:/home/joel/.nvm/.git/description': Permission denied

indicates a permissions error. NVM_DIR by default installs in $HOME/.nvm, which is the location it's trying to install from.

ljharb avatar May 30 '23 16:05 ljharb

@ljharb The problem is that C:/home/joel/.nvm/ doesn't exist. In cygwin the $HOME is pointing to /home/username. The C: is unnecessary and wrong here.

Lamera avatar May 31 '23 07:05 Lamera

aha, thanks. That's strange then. How is git installed?

ljharb avatar May 31 '23 18:05 ljharb

winget install --id=Git.Git -e --accept-source-agreements --scope machine

Lamera avatar Jun 01 '23 14:06 Lamera

I'm not familiar with winget but is there any chance the issue is caused by that git installation, considering the C: first appears in git, and not in the path nvm's install script sends to git?

ljharb avatar Jun 01 '23 16:06 ljharb