Skip to content

Running cpx tinker throws fatal error in cpx/cpx/files/psysh-config.php #3

@N-Molham

Description

@N-Molham

Hello,

I love this tool, it is pretty useful and I can see myself using it in multiple ways.

An issue I am facing when trying to run cpx tinker, it leads to Warning: require_once(~/.composer/vendor/cpx/cpx/files/../vendor/autoload.php): Failed to open stream: No such file or directory

I did some debugging and found to resolve the issue, I had to modify the files/psysh-config.php to the adjust the require_once line to be:

- require_once __DIR__ . '/../vendor/autoload.php';
+ require_once __DIR__ . '/../../../../vendor/autoload.php';

Not sure if it because I already had psys installed globally before or not.

For context:

$ cpx --version
cpx version: 1.0.2
php version: 8.2.20
Installed global packages

Installed global packages

{
    "installed": [
        {
            "name": "beyondcode/expose",
            "direct-dependency": true,
            "homepage": "https://sharedwithexpose.com",
            "source": "https://github.com/beyondcode/expose/tree/2.6.2",
            "version": "2.6.2",
            "description": "Create public URLs for local sites through any firewall and VPN.",
            "abandoned": false
        },
        {
            "name": "cpx/cpx",
            "direct-dependency": true,
            "homepage": null,
            "source": "https://github.com/imliam/cpx",
            "version": "1.0.2",
            "description": "Run any command from any composer package, even if it's not installed in your project.",
            "abandoned": false
        },
        {
            "name": "eriktorsner/wp-bootstrap",
            "direct-dependency": true,
            "homepage": "https://github.com/eriktorsner/wp-bootstrap/",
            "source": "https://github.com/eriktorsner/wp-bootstrap/tree/master",
            "version": "0.5.2",
            "description": "Utils for bootstrapping a WordPress installation",
            "abandoned": false
        },
        {
            "name": "friendsofphp/php-cs-fixer",
            "direct-dependency": true,
            "homepage": null,
            "source": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/tree/v2.19.3",
            "version": "v2.19.3",
            "description": "A tool to automatically fix PHP code style",
            "abandoned": false
        },
        {
            "name": "laravel/installer",
            "direct-dependency": true,
            "homepage": null,
            "source": "https://github.com/laravel/installer/tree/v4.2.10",
            "version": "v4.2.10",
            "description": "Laravel application installer.",
            "abandoned": false
        },
        {
            "name": "laravel/valet",
            "direct-dependency": true,
            "homepage": null,
            "source": "https://github.com/laravel/valet/tree/v4.0.0",
            "version": "v4.0.0",
            "description": "A more enjoyable local development experience for Mac.",
            "abandoned": false
        },
        {
            "name": "psy/psysh",
            "direct-dependency": true,
            "homepage": "http://psysh.org",
            "source": "https://github.com/bobthecow/psysh/tree/v0.12.4",
            "version": "v0.12.4",
            "description": "An interactive shell for modern PHP.",
            "abandoned": false
        },
        {
            "name": "squizlabs/php_codesniffer",
            "direct-dependency": true,
            "homepage": "https://github.com/squizlabs/PHP_CodeSniffer",
            "source": "https://github.com/squizlabs/PHP_CodeSniffer",
            "version": "3.6.2",
            "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.",
            "abandoned": false
        },
        {
            "name": "wp-cli/wp-cli-bundle",
            "direct-dependency": true,
            "homepage": "https://wp-cli.org",
            "source": "https://github.com/wp-cli/wp-cli-bundle",
            "version": "v2.11.0",
            "description": "WP-CLI bundle package with default commands.",
            "abandoned": false
        }
    ]
}

Update

After trying to fix the require_one path, I am getting different error:

Symfony\Component\ErrorHandler\Error\FatalError^ {#1250
  #message: "Compile Error: Declaration of Symfony\Component\Console\Input\ArrayInput::parse() must be compatible with Symfony\Component\Console\Input\Input::parse(): void"
  #code: 0
  #file: "~/.composer/vendor/symfony/console/Input/ArrayInput.php"
  #line: 130
  -error: array:4 [
    "type" => 64
    "message" => "Declaration of Symfony\Component\Console\Input\ArrayInput::parse() must be compatible with Symfony\Component\Console\Input\Input::parse(): void"
    "file" => "~/.composer/vendor/symfony/console/Input/ArrayInput.php"
    "line" => 130
  ]
}

Appreciate your efforts.

Thanks,
Nabeel

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions