degit icon indicating copy to clipboard operation
degit copied to clipboard

degit throws could not download file error on every try.

Open simonxabris opened this issue 5 years ago • 6 comments

Hi!

I have tried using degit, but no matter what repo I try to clone it throws a ! could not download ... error. I forked and cloned the repo was able to pinpoint the error to this line https://github.com/Rich-Harris/degit/blob/7531fbe9b752ad4e02ead547150d2e4ed1ec933a/src/index.js#L129

I've added a console.log right above the line and logged the caught error which gave me this output:

degit_error

I've went further and located that it actually errors here on line 69: https://github.com/Rich-Harris/degit/blob/7531fbe9b752ad4e02ead547150d2e4ed1ec933a/src/utils.js#L66-L69

I think it is worth mentioning that I use volta for managing node versions, that may have an effect on permissions.

I'd be happy to help solve this, submit a PR or something, but at this point I don't know which direction I should go.

simonxabris avatar Jan 07 '20 09:01 simonxabris

Same problem here. It started with a certificate problem with git that I fixed by temporarily disabling ssl checking for git. Could be ssl verification here too? (SSL decryption at firewall using cert). I'm getting the same error now on the same file: ! could not download https://github.com/sveltejs/template/archive/4b6ab60fe58c8404d674b58faa08659d832605cc.tar.gz

I don't see any SSL verification in the code though.

paladinu avatar Jan 09 '20 20:01 paladinu

I got this error when trying to degit a private repository. README stated that it doesn't support private repository yet.

But I tried with -m=git option, it works.

ducva avatar May 19 '20 15:05 ducva

My home dir is not writable (because a bunch of tools like degit use it as a dumping ground) so I solved it by creating a writable ~/.degit directory

fregante avatar Sep 23 '20 02:09 fregante

I tried what @ducva did and got this:

image

after writing 'yes'...

image

Hope it helps.

Quantme avatar May 05 '21 02:05 Quantme

PowerShell $env:HTTPS_PROXY="http://127.0.0.1:1080" cmd set https_proxy=http://127.0.0.1:1080

I'm ok image

yuwade avatar Jul 02 '22 12:07 yuwade

PowerShell $env:HTTPS_PROXY="http://127.0.0.1:1080" cmd set https_proxy=http://127.0.0.1:1080

I'm ok image

thank you, It works

RobertChaw avatar Oct 11 '22 17:10 RobertChaw