LoginSignup
0
0

`curl error 28 while downloading https://repo.packagist.org/packages.json` でLaravelインストールできない

Posted at

こちらに沿って環境構築をしていた

やりたいこと

Laravelをインストールする

発生した問題

create project できない

root@6d7f8f27a943:/data# composer create-project --prefer-dist "laravel/laravel" .
Creating a "laravel/laravel" project at "./"


  [Composer\Downloader\TransportException]
  curl error 28 while downloading https://repo.packagist.org/packages.json: Operation timed out after 10004 milliseconds with 0 out of 0 bytes received


create-project [-s|--stability STABILITY] [--prefer-source] [--prefer-dist] [--prefer-install PREFER-INSTALL] [--repository REPOSITORY] [--repository-url REPOSITORY-URL] [--add-repository] [--dev] [--no-dev] [--no-custom-installers] [--no-scripts] [--no-progress] [--no-secure-http] [--keep-vcs] [--remove-vcs] [--no-install] [--ignore-platform-req IGNORE-PLATFORM-REQ] [--ignore-platform-reqs] [--ask] [--] [<package>] [<directory>] [<version>]

対応

composer diagnoseというトラブルシューティング用のコマンドがあるのでたたいてみたところ

root@6d7f8f27a943:/data# composer diagnose
Checking platform settings: OK
Checking git settings: OK
Checking http connectivity to packagist: OK
Checking https connectivity to packagist: OK
Checking github.com rate limit: OK
Checking disk free space: OK
Checking pubkeys: FAIL
Missing pubkey for tags verification
Missing pubkey for dev verification
Run composer self-update --update-keys to set them up
Checking composer version: You are not running the latest stable version, run `composer self-update` to update (2.2.22 => 2.6.6)
Composer version: 2.2.22
PHP version: 8.1.20
PHP binary path: /usr/local/bin/php
OpenSSL version: OpenSSL 1.1.1n  15 Mar 2022
cURL version: 7.64.0 libz 1.2.11 ssl OpenSSL/1.1.1n
zip: extension present, unzip present, 7-Zip not available

なんかFAILになっている.

Checking pubkeys: FAIL
Missing pubkey for tags verification
Missing pubkey for dev verification
Run composer self-update --update-keys to set them up

指示に従ってcomposer self-updateを実行

root@6d7f8f27a943:/data# composer self-update
Upgrading to version 2.6.6 (stable channel).

Use composer self-update --rollback to return to version 2.2.22

そして、再度create project してみる

root@6d7f8f27a943:/data# composer create-project --prefer-dist "laravel/laravel" .
Creating a "laravel/laravel" project at "./"
Installing laravel/laravel (v10.3.2)
  - Downloading laravel/laravel (v10.3.2)
  - Installing laravel/laravel (v10.3.2): Extracting archive
  ...
  ...
  ...

無事 create project できた

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0