Valet: Valet 2.2.3 install error

Created on 11 Apr 2019  Â·  9Comments  Â·  Source: laravel/valet

Running valet install using version 2.2.3 produces an error:

```valet install
Stopping nginx...

Fatal error: Uncaught Error: Call to undefined method Symfony\Component\Process\Process::fromShellCommandline() in /Users/alex/.composer/vendor/laravel/valet/cli/Valet/CommandLine.php:77
Stack trace:

0 /Users/alex/.composer/vendor/laravel/valet/cli/Valet/CommandLine.php(63): Valet\CommandLine->runCommand('sudo -u "alex" ...', Object(Closure))

1 /Users/alex/.composer/vendor/laravel/valet/cli/Valet/Brew.php(48): Valet\CommandLine->runAsUser('brew list | gre...')

2 /Users/alex/.composer/vendor/laravel/valet/cli/Valet/Brew.php(91): Valet\Brew->installed('nginx-full')

3 /Users/alex/.composer/vendor/laravel/valet/cli/Valet/Nginx.php(159): Valet\Brew->nginxServiceName()

4 /Users/alex/.composer/vendor/laravel/valet/cli/includes/facades.php(28): Valet\Nginx->stop()

5 /Users/alex/.composer/vendor/laravel/valet/cli/valet.php(49): Facade::__callStatic('stop', Array)

6 [internal function]: Silly\Application->{closure}()

7 /Users/alex/.composer/vendor/php-di/invoker/src/Invoker.php(82): call_user_func_array(Object(Closure), Arr in /Users/alex/.composer/vendor/laravel/valet/cli/Valet/CommandLine.php on line 77

```

Installing Laravel Valet 2.2.2 with Composer instead fixes this problem.

Most helpful comment

@alexmck @Artnforces do you mind testing the following to help us determine the most effective "fix" for this?

  1. Tell us what's in your global composer.json: cat ~/.composer/composer.json

  2. What's your PHP version? and MacOS version?

  3. Force-delete old versions of global packages, and re-install latest:

rm -rf ~/.composer/vendor ~/.composer/composer.lock
composer global update

After running this, do the symptoms persist?

All 9 comments

Ah—we just made that change in order to stop relying on a deprecated method and we may have to introduce a stricter requirement on the Symfony dependency. For now, can you run ‘composer global update’ and see if it helps at all? I’ll try to test this out a bit later.

Ah—we just made that change in order to stop relying on a deprecated method and we may have to introduce a stricter requirement on the Symfony dependency. For now, can you run ‘composer global update’ and see if it helps at all? I’ll try to test this out a bit later.

I have tried this and still have the same message.

My gut is to revert that change, since it's just deprecated for now, and then resolve the issue where we're allowing older versions of Symfony's process component and how to update the deprecation there.

@alexmck @Artnforces do you mind testing the following to help us determine the most effective "fix" for this?

  1. Tell us what's in your global composer.json: cat ~/.composer/composer.json

  2. What's your PHP version? and MacOS version?

  3. Force-delete old versions of global packages, and re-install latest:

rm -rf ~/.composer/vendor ~/.composer/composer.lock
composer global update

After running this, do the symptoms persist?

rm -rf ~/.composer/vendor ~/.composer/composer.lock

global composer.json:
{
"require": {
"laravel/installer": "^1.3",
"laravel/valet": "^2.2"
}
}

PHP Version :
PHP 7.3.1 (cli) (built: Feb 1 2019 12:26:46) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.1, Copyright (c) 1998-2018 Zend Technologies

MacOs version
OS El Capitan 10.11.6

Nothing has change under the sky! :-(

Fatal error: Uncaught Error: Call to undefined method Symfony\Component\Process\Process::fromShellCommandline() in /Users/simpleFX/.composer/vendor/laravel/valet/cli/Valet/CommandLine.php on line 77

Error: Call to undefined method Symfony\Component\Process\Process::fromShellCommandline() in /Users/simpleFX/.composer/vendor/laravel/valet/cli/Valet/CommandLine.php on line 77

Call Stack:
    0.0007     417520   1. {main}() /Users/simpleFX/.composer/vendor/laravel/valet/cli/valet.php:0
    0.0203    2207584   2. Symfony\Component\Console\Application->run() /Users/simpleFX/.composer/vendor/laravel/valet/cli/valet.php:304
    0.0324    2468640   3. Symfony\Component\Console\Application->doRun() /Users/simpleFX/.composer/vendor/symfony/console/Application.php:148
    0.0330    2471936   4. Symfony\Component\Console\Application->doRunCommand() /Users/simpleFX/.composer/vendor/symfony/console/Application.php:255
    0.0330    2471936   5. Symfony\Component\Console\Command\Command->run() /Users/simpleFX/.composer/vendor/symfony/console/Application.php:960
    0.0332    2473432   6. Silly\Application->Silly\{closure}() /Users/simpleFX/.composer/vendor/symfony/console/Command/Command.php:253
    0.0343    2632288   7. Invoker\Invoker->call() /Users/simpleFX/.composer/vendor/mnapoli/silly/src/Application.php:95
    0.0344    2632536   8. call_user_func_array:{/Users/simpleFX/.composer/vendor/php-di/invoker/src/Invoker.php:82}() /Users/simpleFX/.composer/vendor/php-di/invoker/src/Invoker.php:82
    0.0344    2632600   9. Silly\Application->{closure:/Users/simpleFX/.composer/vendor/laravel/valet/cli/valet.php:48-59}() /Users/simpleFX/.composer/vendor/php-di/invoker/src/Invoker.php:82
    0.0344    2632600  10. Facade::stop() /Users/simpleFX/.composer/vendor/laravel/valet/cli/valet.php:49
    0.0344    2632656  11. Facade::__callStatic() /Users/simpleFX/.composer/vendor/laravel/valet/cli/valet.php:49
    0.0368    2805840  12. Valet\Nginx->stop() /Users/simpleFX/.composer/vendor/laravel/valet/cli/includes/facades.php:28
    0.0372    2805840  13. Valet\Brew->nginxServiceName() /Users/simpleFX/.composer/vendor/laravel/valet/cli/Valet/Nginx.php:159
    0.0372    2805840  14. Valet\Brew->installed() /Users/simpleFX/.composer/vendor/laravel/valet/cli/Valet/Brew.php:91
    0.0372    2805896  15. Valet\CommandLine->runAsUser() /Users/simpleFX/.composer/vendor/laravel/valet/cli/Valet/Brew.php:48
    0.0372    2805976  16. Valet\CommandLine->runCommand() /Users/simpleFX/.composer/vendor/laravel/valet/cli/Valet/CommandLine.php:63


This is what happened when running composer global update :
`Updating dependencies (including require-dev)
Package operations: 23 installs, 0 updates, 0 removals

  • Installing symfony/process (v3.4.24): Loading from cache
  • Installing symfony/polyfill-ctype (v1.11.0): Loading from cache
  • Installing symfony/filesystem (v3.4.24): Loading from cache
  • Installing symfony/polyfill-mbstring (v1.11.0): Loading from cache
  • Installing psr/log (1.1.0): Loading from cache
  • Installing symfony/debug (v3.4.24): Loading from cache
  • Installing symfony/console (v3.4.24): Loading from cache
  • Installing guzzlehttp/promises (v1.3.1): Loading from cache
  • Installing ralouphie/getallheaders (2.0.5): Loading from cache
  • Installing psr/http-message (1.0.1): Downloading (100%)
  • Installing guzzlehttp/psr7 (1.5.2): Loading from cache
  • Installing guzzlehttp/guzzle (6.3.3): Loading from cache
  • Installing laravel/installer (v1.5.0): Loading from cache
  • Installing symfony/var-dumper (v3.4.24): Loading from cache
  • Installing tightenco/collect (v5.5.45): Loading from cache
  • Installing nategood/httpful (0.2.20): Loading from cache
  • Installing psr/container (1.0.0): Loading from cache
  • Installing php-di/invoker (2.0.0): Loading from cache
  • Installing mnapoli/silly (1.7.1): Loading from cache
  • Installing psr/simple-cache (1.0.1): Loading from cache
  • Installing illuminate/contracts (v5.5.44): Loading from cache
  • Installing illuminate/container (v5.5.44): Loading from cache
  • Installing laravel/valet (v2.2.3): Loading from cache
    symfony/console suggests installing symfony/event-dispatcher ()
    symfony/console suggests installing symfony/lock ()
    symfony/var-dumper suggests installing ext-symfony_debug ()
    Writing lock file
    `
    As I see composer have loaded update from cache , I clean cache and try it again to see what will happen.

But ..still have the error.

"laravel/installer": "^1.3",

That might be your issue.

Try running this to update it to newer:
composer global require laravel/installer

(or manually change it from ^1.3 to >1.3 and run composer global update)

Anyone getting this issue, you have some out of date global Composer dependencies, which you should review and update.

However, we've also reverted this change in https://github.com/laravel/valet/releases/tag/v2.2.4 and will come up with a solution that doens't force everyone to upgrade immediately.

Anyone who saw this problem earlier, would you mind testing this PR out if you know how to test PRs?

https://github.com/laravel/valet/pull/766

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sadhakbj picture sadhakbj  Â·  3Comments

papakay picture papakay  Â·  3Comments

VinceG picture VinceG  Â·  3Comments

tomirons picture tomirons  Â·  4Comments

Alshie picture Alshie  Â·  4Comments