5

I'm trying to initiate astro. When i don't choose a framework i get this error although i have git installed and fully working. Any help will be highly appreciated.

√ Which frameworks would you like to use? »
> Copying project files...
could not find commit hash for latest
This seems to be an issue with degit. Please check if you have 'git' installed on your system, and install it if you don't have (https://git-scm.com).  
If you do have 'git' installed, please file a new issue here: https://github.com/withastro/astro/issues
Zoe
  • 27,060
  • 21
  • 118
  • 148
yarshehry
  • 51
  • 1

2 Answers2

1

It depends on your OS and environment.

For instance, withastro/astro issue 2144 reports the exact same error message, but on Windows, using Linux on WSL2 (Ubuntu 20.04.3 LTS).
Double-check your %PATH%/$PATH in your execution environment.


Update Oct. 2022, ten month later: withastro/astro issue 2144 is reported closed with the workaround by Matej Bunček:

As I was researching this seems to be a general issue with NPM for those who uses SSH.
There's an open issue here: npm/cli#2610 which is still far from being resolved and it's a huge thread.

Some folks might be interested in these workarounds to get it working.

git config --global url."https://github.com/".insteadOf git@github.com:
git config --global url."https://".insteadOf git://

Also I've tried yarn, npm and pnpm, all of them seems to have same problem so I believe it's core problem of node.
Also both npm 6 and 7 are not working.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
0

Not a direct solution to your error message, but a general solution for those kinds of errors:

I would recommend doing the development inside docker containers, so called devcontainers.

Since you will develop in separate and isolated environments containing only the project's minimum dependencies and tools, it is a lot less likely to face OS specific issues in general.

Here are some resources to get started:

David Wolf
  • 1,400
  • 1
  • 9
  • 18