使用composer创建laravel项目时面临的问题



我在laravel创建新项目时遇到了这个错误。

我的命令是-

laravel new project-name

错误是

- Installing laravel/laravel (v10.0.5): Cloning 9ae75b58a1
Install of laravel/laravel failed
In Git.php line 471:
Failed to clone https://github.com/laravel/laravel.git via https, ssh protocols, aborting.
- https://github.com/laravel/laravel.git
Cloning into 'C:UsersDellDesktopecommerce-appecom'...
fatal: the remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed
- git@github.com:laravel/laravel.git
Cloning into 'C:UsersDellDesktopecommerce-appecom'...
Host key verification failed.
fatal: Could not read from remote repository.
```
How to resolve the error?

尝试以下方法:

composer clear-cache
laravel new project-name

:

composer self-update
laravel new project-name