composer / composer

Dependency Manager for PHP
https://getcomposer.org/
MIT License
28.4k stars 4.49k forks source link

Argument 2 passed to Composer\Pcre\Preg::matchAll() must be of the type string, null given #11553

Closed rmsite closed 1 year ago

rmsite commented 1 year ago

My composer.json:

{
    "name": "laravel/laravel",
    "type": "project",
    "description": "The Laravel Framework.",
    "keywords": [
        "framework",
        "laravel"
    ],
    "license": "MIT",
    "require": {
        "php": "^7.2",
        "artesaos/seotools": "^0.16.0",
        "fideloper/proxy": "^4.0",
        "guzzlehttp/guzzle": "^7.7",
        "laravel/framework": "^6.2",
        "laravel/tinker": "^2.0"
    },
    "require-dev": {
        "facade/ignition": "^1.4",
        "fzaninotto/faker": "^1.9.1",
        "laravel/ui": "^1.1",
        "mockery/mockery": "^1.0",
        "nunomaduro/collision": "^3.0",
        "phpunit/phpunit": "^8.0"
    },
    "config": {
        "preferred-install": "dist",
        "sort-packages": true
    },
    "extra": {
        "laravel": {
            "dont-discover": []
        }
    },
    "autoload": {
        "psr-4": {
            "App\\": "app/"
        },
        "classmap": [
            "database/seeds",
            "database/factories"
        ]
    },
    "autoload-dev": {
        "psr-4": {
            "Tests\\": "tests/"
        }
    },
    "minimum-stability": "dev",
    "prefer-stable": true,
    "scripts": {
        "post-autoload-dump": [
            "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
            "@php artisan package:discover --ansi"
        ],
        "post-root-package-install": [
            "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "@php artisan key:generate --ansi"
        ]
    }
}

Output of composer diagnose:

Checking composer.json: OK
Checking platform settings: OK
Checking git settings: proc_open is not available, git cannot be used
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: 
Tags Public Key Fingerprint: 57815BA2 7E54DC31 7ECC7CC5 573090D0  87719BA6 8F3BB723 4E5D42D0 84A14642
Dev Public Key Fingerprint: 4AC45767 E5EC2265 2F0C1167 CBBB8A2B  0C708369 153E328C AD90147D AFE50952
OK
Checking composer version: OK
Composer version: 2.5.8
PHP version: 7.4.11
PHP binary path: /opt/lc/php/7.4/bin/php
OpenSSL version: OpenSSL 1.0.2k  26 Jan 2017
cURL version: 7.29.0 libz 1.2.7 ssl NSS/3.53.1
zip: extension present, unzip not available, 7-Zip not available

When I run this command:

Checking composer.json: OK
Checking platform settings: OK
Checking git settings: proc_open is not available, git cannot be used
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: 
Tags Public Key Fingerprint: 57815BA2 7E54DC31 7ECC7CC5 573090D0  87719BA6 8F3BB723 4E5D42D0 84A14642
Dev Public Key Fingerprint: 4AC45767 E5EC2265 2F0C1167 CBBB8A2B  0C708369 153E328C AD90147D AFE50952
OK
Checking composer version: OK
Composer version: 2.5.8
PHP version: 7.4.11
PHP binary path: /opt/lc/php/7.4/bin/php
OpenSSL version: OpenSSL 1.0.2k  26 Jan 2017
cURL version: 7.29.0 libz 1.2.7 ssl NSS/3.53.1
zip: extension present, unzip not available, 7-Zip not available
[casaxvillalobos2@vpshost1486 ~]$ php composer.phar diagnose -vvv
Running 2.5.8 (2023-06-09 17:13:21) with PHP 7.4.11 on Linux / 4.4.79-grsec-1.lc.x86_64
Reading ./composer.json (/home/storage/e/b4/72/casaxvillalobos2/composer.json)
Loading config file ./composer.json (/home/storage/e/b4/72/casaxvillalobos2/composer.json)
Checked CA file /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem: valid
Failed to initialize global composer: Composer could not find the config file: /home/storage/e/b4/72/casaxvillalobos2/.config/composer/composer.json

Reading ./composer.lock (/home/storage/e/b4/72/casaxvillalobos2/composer.lock)
Reading /home/storage/e/b4/72/casaxvillalobos2/vendor/composer/installed.json
Checking composer.json: Reading ./composer.json (/home/storage/e/b4/72/casaxvillalobos2/composer.json)
OK
Checking platform settings: OK
Checking git settings: proc_open is not available, git cannot be used
Checking http connectivity to packagist: Downloading http://repo.packagist.org/packages.json
[200] http://repo.packagist.org/packages.json
OK
Checking https connectivity to packagist: Downloading https://repo.packagist.org/packages.json
[200] https://repo.packagist.org/packages.json
OK
Checking github.com rate limit: Downloading https://api.github.com/rate_limit
[200] https://api.github.com/rate_limit
OK
Checking disk free space: OK
Checking pubkeys: 
Tags Public Key Fingerprint: 57815BA2 7E54DC31 7ECC7CC5 573090D0  87719BA6 8F3BB723 4E5D42D0 84A14642
Dev Public Key Fingerprint: 4AC45767 E5EC2265 2F0C1167 CBBB8A2B  0C708369 153E328C AD90147D AFE50952
OK
Checking composer version: Downloading https://getcomposer.org/versions
[200] https://getcomposer.org/versions
OK
Composer version: 2.5.8
PHP version: 7.4.11
PHP binary path: /opt/lc/php/7.4/bin/php
OpenSSL version: OpenSSL 1.0.2k  26 Jan 2017
cURL version: 7.29.0 libz 1.2.7 ssl NSS/3.53.1
zip: extension present, unzip not available, 7-Zip not available

I get the following output:

php composer.phar install
Installing dependencies from lock file (including require-dev)
Verifying lock file contents can be installed on current platform.
Nothing to install, update or remove
Package swiftmailer/swiftmailer is abandoned, you should avoid using it. Use symfony/mailer instead.
Package symfony/debug is abandoned, you should avoid using it. Use symfony/error-handler instead.
Package fzaninotto/faker is abandoned, you should avoid using it. No replacement was suggested.
Package phpunit/php-token-stream is abandoned, you should avoid using it. No replacement was suggested.
Generating autoload files

In Preg.php line 88:

  [TypeError]                                                                  
  Argument 2 passed to Composer\Pcre\Preg::matchAll() must be of the type str  
  ing, null given, called in phar:///home/storage/e/b4/72/casaxvillalobos2/co  
  mposer.phar/vendor/composer/class-map-generator/src/PhpFileParser.php on li  
  ne 55                                                                        

Exception trace:
  at phar:///home/storage/e/b4/72/casaxvillalobos2/composer.phar/vendor/composer/pcre/src/Preg.php:88
 Composer\Pcre\Preg::matchAll() at phar:///home/storage/e/b4/72/casaxvillalobos2/composer.phar/vendor/composer/class-map-generator/src/PhpFileParser.php:55
 Composer\ClassMapGenerator\PhpFileParser::findClasses() at phar:///home/storage/e/b4/72/casaxvillalobos2/composer.phar/vendor/composer/class-map-generator/src/ClassMapGenerator.php:176
 Composer\ClassMapGenerator\ClassMapGenerator->scanPaths() at phar:///home/storage/e/b4/72/casaxvillalobos2/composer.phar/src/Composer/Autoload/AutoloadGenerator.php:314
 Composer\Autoload\AutoloadGenerator->dump() at phar:///home/storage/e/b4/72/casaxvillalobos2/composer.phar/src/Composer/Installer.php:349
 Composer\Installer->run() at phar:///home/storage/e/b4/72/casaxvillalobos2/composer.phar/src/Composer/Command/InstallCommand.php:146
 Composer\Command\InstallCommand->execute() at phar:///home/storage/e/b4/72/casaxvillalobos2/composer.phar/vendor/symfony/console/Command/Command.php:298
 Symfony\Component\Console\Command\Command->run() at phar:///home/storage/e/b4/72/casaxvillalobos2/composer.phar/vendor/symfony/console/Application.php:1040
 Symfony\Component\Console\Application->doRunCommand() at phar:///home/storage/e/b4/72/casaxvillalobos2/composer.phar/vendor/symfony/console/Application.php:301
 Symfony\Component\Console\Application->doRun() at phar:///home/storage/e/b4/72/casaxvillalobos2/composer.phar/src/Composer/Console/Application.php:378
 Composer\Console\Application->doRun() at phar:///home/storage/e/b4/72/casaxvillalobos2/composer.phar/vendor/symfony/console/Application.php:171
 Symfony\Component\Console\Application->run() at phar:///home/storage/e/b4/72/casaxvillalobos2/composer.phar/src/Composer/Console/Application.php:141
 Composer\Console\Application->run() at phar:///home/storage/e/b4/72/casaxvillalobos2/composer.phar/bin/composer:88
 require() at /home/storage/e/b4/72/casaxvillalobos2/composer.phar:29

install [--prefer-source] [--prefer-dist] [--prefer-install PREFER-INSTALL] [--dry-run] [--download-only] [--dev] [--no-suggest] [--no-dev] [--no-autoloader] [--no-progress] [--no-install] [--audit] [--audit-format AUDIT-FORMAT] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--apcu-autoloader-prefix APCU-AUTOLOADER-PREFIX] [--ignore-platform-req IGNORE-PLATFORM-REQ] [--ignore-platform-reqs] [--] [<packages>...]

And I expected this to happen: I try to install packages on the host to publish a Laravel application Laravel 5.6 PHP 7.4.11

rmsite commented 1 year ago

The problem is with host. Please close this.