composer 1X版本install无法链接到镜像站,安装包显示404链接

1. 运行环境

1). 当前使用的 Laravel 版本?

5.5

2). 当前使用的 php/php-fpm 版本?

PHP 版本:7.3.29

php-fpm 版本:7.3.29

3). 当前系统

Centos 7.9

4). 业务环境

开发环境

5). 相关软件版本

composer 1.9.3

2. 问题描述?

1X版本不会强制验证供应商名称,但是2X会,所以项目会使用composer 1X,升级到2X以后,安装其他项目是正常安装的,但是因为这个项目含有自定义的repositories,所以不能升级到2X,之前1X版本是正常使用的,团队的其他人也是正常使用的

我试过更换市面上的各种镜像站,都是无果。
也谷歌了很多方法,试过了很多composer版本,唯独1X不行,团队里就我这台不行

报错内容:The “https://mirrors.aliyun.com/composer/p/provider-2017%248f788d2accc98ba0f380fab82c5ddcec06015d3e42ce7b4996d72342c781940b.json" file could not be downloaded (HTTP/1.1 404 Not Found)

升级到2X的话,项目这边composer.json又不符合规范,现在又不能大改,问过团队要过他们的composer.phar,同样的版本,还是报错。

运行命令

composer install -vvv

composer.json

{
    "name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "type": "project",
    "repositories": [
      {
        "type": "path",
        "url": "libs/repositories/laravel-admin"
      },
      {
        "type": "path",
        "url": "libs/repositories/laravel-admin-ext/helpers"
      },
      {
        "type": "path",
        "url": "libs/repositories/laravel-admin-ext/scheduling"
      },
      {
        "type": "path",
        "url": "libs/repositories/laravel-admin-ext/ueditor"
      }
    ],
  "require": {
        "php": ">=7.0.0",
        "barryvdh/laravel-cors": "^1.0",
        "chumper/zipper": "^1.0",
        "elasticsearch/elasticsearch": "6.5.*",
        "fideloper/proxy": "~3.3",
        "hashids/hashids": "^4.0",
        "intervention/image": "^2.4",
        "laravel-admin": "dev-develop",
        "laravel-admin-ex/helpers": "dev-develop",
        "laravel-admin-ex/scheduling": "dev-develop",
        "laravel-admin-ex/ueditor": "dev-develop",
        "laravel/framework": "5.5.*",
        "laravel/scout": "^6.1",
        "laravel/tinker": "~1.0",
        "lustre/php-dfa-sensitive": "^1.4",
        "maatwebsite/excel": "^3.1",
        "mews/purifier": "~3.0",
        "overtrue/wechat": "^4.1",
        "predis/predis": "^1.1",
        "prettus/l5-repository": "^2.6",
        "simplesoftwareio/simple-qrcode": "^2.0",
        "tymon/jwt-auth": "^1.0",
        "yansongda/pay": "^2.5"
    },
    "require-dev": {
        "barryvdh/laravel-debugbar": "^3.2",
        "barryvdh/laravel-ide-helper": "^2.5",
        "doctrine/dbal": "^2.8",
        "filp/whoops": "~2.0",
        "fzaninotto/faker": "~1.4",
        "mockery/mockery": "~1.0",
        "phpunit/phpunit": "~6.0",
        "symfony/thanks": "^1.0"
    },
    "autoload": {
        "classmap": [
            "database/seeds",
            "database/factories",
            "libs/captcha"
        ],
        "psr-4": {
            "App\\": "app/",
            "Aliyun\\": "libs/sms/vendor/aliyun/",
            "Aix\\Sms\\": "libs/sms/src/",
            "Aix\\Pay\\": "libs/pay/src/",
            "Gt\\": "libs/gt3/lib/"
        },
        "files": [
            "bootstrap/helpers.php"
        ]
    },
    "autoload-dev": {
        "psr-4": {
            "Tests\\": "tests/"
        }
    },
    "extra": {
        "laravel": {
            "dont-discover": [
            ]
        }
    },
    "scripts": {
        "post-root-package-install": [
            "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "@php artisan key:generate"
        ],
        "post-autoload-dump": [
            "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
            "@php artisan package:discover"
        ]
    },
    "config": {
        "preferred-install": "dist",
        "sort-packages": true,
        "optimize-autoloader": true
    }
}

composer config

[repositories.3.type] path
[repositories.3.url] libs/repositories/laravel-admin
[repositories.2.type] path
[repositories.2.url] libs/repositories/laravel-admin-ext/helpers
[repositories.1.type] path
[repositories.1.url] libs/repositories/laravel-admin-ext/scheduling
[repositories.0.type] path
[repositories.0.url] libs/repositories/laravel-admin-ext/ueditor
[repositories.packagist.org.type] composer
[repositories.packagist.org.url] https://mirrors.aliyun.com/composer/
[process-timeout] 300
[use-include-path] false
[preferred-install] dist
[notify-on-install] true
[github-protocols] [https, ssh]
[cache-dir] /root/.cache/composer
[data-dir] /root/.local/share/composer
[cache-files-dir] {$cache-dir}/files (/root/.cache/composer/files)
[cache-repo-dir] {$cache-dir}/repo (/root/.cache/composer/repo)
[cache-vcs-dir] {$cache-dir}/vcs (/root/.cache/composer/vcs)
[cache-ttl] 15552000
[cache-files-ttl] 15552000
[cache-files-maxsize] 300MiB (314572800)
[bin-compat] auto
[discard-changes] false
[autoloader-suffix] 
[sort-packages] true
[optimize-autoloader] true
[classmap-authoritative] false
[apcu-autoloader] false
[prepend-autoloader] true
[github-domains] [github.com]
[bitbucket-expose-hostname] true
[disable-tls] false
[secure-http] true
[cafile] 
[capath] 
[github-expose-hostname] true
[gitlab-domains] [gitlab.com]
[store-auths] prompt
[archive-format] tar
[archive-dir] .
[htaccess-protect] true
[use-github-api] true
[home] /root/.config/composer

3. 您期望得到的结果?

正常运行 install

4. 您实际得到的结果?

错误详细信息

[root@localhost XXX]# composer install -vvv
Reading ./composer.json
Loading config file /root/.config/composer/config.json
Loading config file /root/.config/composer/auth.json
Loading config file ./composer.json
Checked CA file /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem: valid
Executing command (/www/wwwroot/xxxx): git branch --no-color --no-abbrev -v
Deprecation warning: require.laravel-admin is invalid, it should have a vendor name, a forward slash, and a package name. The vendor and package name can be words separated by -, . or _. The complete name should match "[a-z0-9]([_.-]?[a-z0-9]+)*/[a-z0-9]([_.-]?[a-z0-9]+)*". Make sure you fix this as Composer 2.0 will error.
Reading /root/.config/composer/composer.json
Loading config file /root/.config/composer/config.json
Loading config file /root/.config/composer/auth.json
Loading config file /root/.config/composer/composer.json
Loading config file /root/.config/composer/auth.json
Reading /root/.config/composer/auth.json
Reading /root/.config/composer/vendor/composer/installed.json
Running 1.9.3 (2020-02-04 12:58:49) with PHP 7.3.29 on Linux / 3.10.0-1160.el7.x86_64
Do not run Composer as root/super user! See https://getcomposer.org/root for details
Loading composer repositories with package information
Executing command (/www/wwwroot/xxxx/libs/repositories/laravel-admin/): git branch --no-color --no-abbrev -v
Executing command (/www/wwwroot/xxxx/libs/repositories/laravel-admin-ext/helpers/): git branch --no-color --no-abbrev -v
Executing command (/www/wwwroot/xxxx/libs/repositories/laravel-admin-ext/scheduling/): git branch --no-color --no-abbrev -v
Executing command (/www/wwwroot/xxxx/libs/repositories/laravel-admin-ext/ueditor/): git branch --no-color --no-abbrev -v
Downloading https://mirrors.aliyun.com/composer/packages.json
Warning from https://mirrors.aliyun.com/composer: Support for Composer 1 is deprecated and some packages will not be available. You should upgrade to Composer 2. See https://blog.packagist.com/deprecating-composer-1-support/
Writing /root/.cache/composer/repo/https---mirrors.aliyun.com-composer/packages.json into cache
Updating dependencies (including require-dev)
Reading /root/.cache/composer/repo/https---mirrors.aliyun.com-composer/p-provider-2013.json from cache
Reading /root/.cache/composer/repo/https---mirrors.aliyun.com-composer/p-provider-2014.json from cache
Reading /root/.cache/composer/repo/https---mirrors.aliyun.com-composer/p-provider-2015.json from cache
Reading /root/.cache/composer/repo/https---mirrors.aliyun.com-composer/p-provider-2016.json from cache
Downloading https://mirrors.aliyun.com/composer/p/provider-2017%248f788d2accc98ba0f380fab82c5ddcec06015d3e42ce7b4996d72342c781940b.json


  [Composer\Downloader\TransportException]                                                                                                                                                 
  The "https://mirrors.aliyun.com/composer/p/provider-2017%248f788d2accc98ba0f380fab82c5ddcec06015d3e42ce7b4996d72342c781940b.json" file could not be downloaded (HTTP/1.1 404 Not Found)  


Exception trace:
 () at phar:///usr/local/bin/composer/src/Composer/Util/RemoteFilesystem.php:440
 Composer\Util\RemoteFilesystem->get() at phar:///usr/local/bin/composer/src/Composer/Util/RemoteFilesystem.php:104
 Composer\Util\RemoteFilesystem->getContents() at phar:///usr/local/bin/composer/src/Composer/Repository/ComposerRepository.php:695
 Composer\Repository\ComposerRepository->fetchFile() at phar:///usr/local/bin/composer/src/Composer/Repository/ComposerRepository.php:607
 Composer\Repository\ComposerRepository->loadProviderListings() at phar:///usr/local/bin/composer/src/Composer/Repository/ComposerRepository.php:323
 Composer\Repository\ComposerRepository->whatProvides() at phar:///usr/local/bin/composer/src/Composer/DependencyResolver/Pool.php:204
 Composer\DependencyResolver\Pool->computeWhatProvides() at phar:///usr/local/bin/composer/src/Composer/DependencyResolver/Pool.php:193
 Composer\DependencyResolver\Pool->whatProvides() at phar:///usr/local/bin/composer/src/Composer/DependencyResolver/RuleSetGenerator.php:171
 Composer\DependencyResolver\RuleSetGenerator->whitelistFromPackage() at phar:///usr/local/bin/composer/src/Composer/DependencyResolver/RuleSetGenerator.php:353
 Composer\DependencyResolver\RuleSetGenerator->getRulesFor() at phar:///usr/local/bin/composer/src/Composer/DependencyResolver/Solver.php:217
 Composer\DependencyResolver\Solver->solve() at phar:///usr/local/bin/composer/src/Composer/Installer.php:475
 Composer\Installer->doInstall() at phar:///usr/local/bin/composer/src/Composer/Installer.php:229
 Composer\Installer->run() at phar:///usr/local/bin/composer/src/Composer/Command/InstallCommand.php:122
 Composer\Command\InstallCommand->execute() at phar:///usr/local/bin/composer/vendor/symfony/console/Command/Command.php:245
 Symfony\Component\Console\Command\Command->run() at phar:///usr/local/bin/composer/vendor/symfony/console/Application.php:835
 Symfony\Component\Console\Application->doRunCommand() at phar:///usr/local/bin/composer/vendor/symfony/console/Application.php:185
 Symfony\Component\Console\Application->doRun() at phar:///usr/local/bin/composer/src/Composer/Console/Application.php:267
 Composer\Console\Application->doRun() at phar:///usr/local/bin/composer/vendor/symfony/console/Application.php:117
 Symfony\Component\Console\Application->run() at phar:///usr/local/bin/composer/src/Composer/Console/Application.php:106
 Composer\Console\Application->run() at phar:///usr/local/bin/composer/bin/composer:61
 require() at /usr/local/bin/composer:24

install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [--no-suggest] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--ignore-platform-reqs] [--] [<packages>]...
《L04 微信小程序从零到发布》
从小程序个人账户申请开始,带你一步步进行开发一个微信小程序,直到提交微信控制台上线发布。
《G01 Go 实战入门》
从零开始带你一步步开发一个 Go 博客项目,让你在最短的时间内学会使用 Go 进行编码。项目结构很大程度上参考了 Laravel。
最佳答案
Reading /root/.cache/composer/repo/https---mirrors.aliyun.com-composer/p-provider-2013.json from cache
Reading /root/.cache/composer/repo/https---mirrors.aliyun.com-composer/p-provider-2014.json from cache
Reading /root/.cache/composer/repo/https---mirrors.aliyun.com-composer/p-provider-2015.json from cache
Reading /root/.cache/composer/repo/https---mirrors.aliyun.com-composer/p-provider-2016.json from cache
Downloading https://mirrors.aliyun.com/composer/p/provider-2017%248f788d2accc98ba0f380fab82c5ddcec06015d3e42ce7b4996d72342c781940b.json


  [Composer\Downloader\TransportException]                                                                                                                                                 
  The "https://mirrors.aliyun.com/composer/p/provider-2017%248f788d2accc98ba0f380fab82c5ddcec06015d3e42ce7b4996d72342c781940b.json" file could not be downloaded (HTTP/1.1 404 Not Found)  

看了这个报错,有个猜想,你去找你同事,要一下这些 2017.json 等等文件的缓存,放到你电脑,看下再更新,能不能让它从缓存获取,不再去下载。也许是个解决办法

1年前 评论
讨论数量: 8
Reading /root/.cache/composer/repo/https---mirrors.aliyun.com-composer/p-provider-2013.json from cache
Reading /root/.cache/composer/repo/https---mirrors.aliyun.com-composer/p-provider-2014.json from cache
Reading /root/.cache/composer/repo/https---mirrors.aliyun.com-composer/p-provider-2015.json from cache
Reading /root/.cache/composer/repo/https---mirrors.aliyun.com-composer/p-provider-2016.json from cache
Downloading https://mirrors.aliyun.com/composer/p/provider-2017%248f788d2accc98ba0f380fab82c5ddcec06015d3e42ce7b4996d72342c781940b.json


  [Composer\Downloader\TransportException]                                                                                                                                                 
  The "https://mirrors.aliyun.com/composer/p/provider-2017%248f788d2accc98ba0f380fab82c5ddcec06015d3e42ce7b4996d72342c781940b.json" file could not be downloaded (HTTP/1.1 404 Not Found)  

看了这个报错,有个猜想,你去找你同事,要一下这些 2017.json 等等文件的缓存,放到你电脑,看下再更新,能不能让它从缓存获取,不再去下载。也许是个解决办法

1年前 评论

有点像镜像站的2017的镜像删除了。然后,这种没怎么更新版本的,最好把依赖包版本锁定,用update更新

1年前 评论

去掉镜像,item配置个代理从源站下载吧

1年前 评论

换个镜像源就好了,或者将composer升级

1年前 评论
抄你码科技有限公司 1年前

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!