1

On my Ubuntu 18.04 machine I'm following a tutorial to start a svelte project but I can not authenticate using degit:

$ npx degit sveltesj/template ninjapolls
Username for 'https://github.com': myname
Password for 'https://myname@github.com': mypw
! could not fetch remote https://github.com/sveltesj/template
! could not find commit hash for master

I'm pretty sure that my credentials are correct because I've just logged in to github with it on browser. So what could be wrong here and how can I fix it?

Super Kai - Kazuya Ito
  • 22,221
  • 10
  • 124
  • 129
supermario
  • 2,625
  • 4
  • 38
  • 58

5 Answers5

5

You've got a typo in your degit command: sveltesj instead of sveltejs.

rixo
  • 23,815
  • 4
  • 63
  • 68
3

Dec, 2021 Update:

You need to install "git":

sudo apt install git
Henry Ecker
  • 34,399
  • 18
  • 41
  • 57
Super Kai - Kazuya Ito
  • 22,221
  • 10
  • 124
  • 129
1

You have to install git for degit to work.

Harita Rao
  • 11
  • 1
  • This does not provide an answer to the question. Once you have sufficient [reputation](https://stackoverflow.com/help/whats-reputation) you will be able to [comment on any post](https://stackoverflow.com/help/privileges/comment); instead, [provide answers that don't require clarification from the asker](https://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can-i-do-instead). - [From Review](/review/late-answers/31016169) – danilopopeye Feb 11 '22 at 17:44
0

Git was ok. Running behind a corporate proxy got a similar erro:

λ npx degit chromaui/intro-storybook-angular-template taskbox
npx: instalou 1 em 2.019s
! could not fetch remote https://github.com/chromaui/intro-storybook-angular-template
! could not find commit hash for HEAD

Restarted the local proxy (CNTLM or WinFoom) and it worked fine

0

It might be because the default branch on the targeted repository provider is changed so:

1- First clear the npm cache by:

npm cache clean --force

2- Upgrade digit to the latest version:

npm install -g degit@latest

If none of the above helps check if your git is the latest version or check if you have missed placing it in the environment variable "path",

Arash MAS
  • 128
  • 1
  • 7