Running any drupal console commands results in the following error:
````
PHP Fatal error: Uncaught Error: Call to undefined method
DrupalConsoleCoreUtilsDrupalFinder::getVendorDir()
in /vagrant/vendor/drupal/console-core/src/Utils/DrupalFinder.php:24
Stack trace:
DrupalConsoleCoreUtilsDrupalFinder->locateRoot('/var/www/drupal...')
thrown in /vagrant/vendor/drupal/console-core/src/Utils/DrupalFinder.php on line 24
Fatal error: Uncaught Error: Call to undefined method
DrupalConsoleCoreUtilsDrupalFinder::getVendorDir() in
/vagrant/vendor/drupal/console-core/src/Utils/DrupalFinder.php on line 24
Error: Call to undefined method DrupalConsoleCoreUtilsDrupalFinder::getVendorDir() in
/vagrant/vendor/drupal/console-core/src/Utils/DrupalFinder.php on line 24
Call Stack:
0.0000 350048 1. {main}() /vagrant/vendor/drupal/console/bin/drupal:0
0.0011 363096 2. require('/vagrant/vendor/drupal/console/bin/drupal.php') /vagrant/vendor/drupal/console/bin/drupal:4
0.0461 2202368 3. DrupalConsoleCoreUtilsDrupalFinder->locateRoot() /vagrant/vendor/drupal/console/bin/drupal.php:37
````
drupal/console 1.0.0-rc19 The Drupal CLI. A tool to generate boilerplate code, interact with and debug Drupal.
drupal/console-core 1.0.0-rc19 Drupal Console Core
drupal/console-en 1.0.0-rc19 Drupal Console English Language
drupal/console-extend-plugin 0.6.0 Drupal Console Extend Plugin
Running Drupal 8.3.2
It was working fine until running a recent composer update. Now getting this.
A similar thing happened to me. In my case, I reinstalled the DrupalConsole Launcher and it worked after that.
@welly @jmenke You can also try updating the webflo/drupal-finder package by executing
composer require webflo/drupal-finder:^0.3.0
Same problems here, running above command does not fix my situation @jmolivas. Nothing to install or update
Edit: Downgrading to DC rc18 fixes the problem for me.
@nvaken What command did you use to downgrade?
@jmenke What command did you use to reinstall?
Nevermind, I figured it out:
composer require drupal/console:1.0.0-rc18 --prefer-dist --optimize-autoloader
composer update drupal/console --with-dependencies
nvaken @colans which version of webflo/drupal-finder do you have on the site?
@jmolivas : 0.3.0
composer require webflo/drupal-finder:^0.3.0 works for me, and https://github.com/drupal-composer/drupal-project/commit/4df8a592db3740a164f74a2036b42ea6b2b61e52 has updated
@jmolivas 0.3.0 (read from my composer.lock file)
Awesome to wake up in the morning with a fix for my issue! Thanks guys, working well again
Hi @welly could you please elaborate which fix fixed your issue? This for documentation purposes.
@nvaken apologies, I should have stated that. This worked:
composer require webflo/drupal-finder:^0.3.0
I had the same problem. I can also confirm that this works for me.
Works great by updating webflo to ^0.3.0. Thx for the answer
Just experienced same problem when updating a older project from RC17 to RC19, tried the suggested composer require webflo/drupal-finder:^0.3.0 fix, but still nothing happens. The command returns:
$ composer require webflo/drupal-finder:^0.3.0
./composer.json has been updated
Gathering patches for root package.
> DrupalProject\composer\ScriptHandler::checkComposerVersion
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Writing lock file
Generating autoload files
> DrupalProject\composer\ScriptHandler::createRequiredFiles
It does add webflo/drupal-finder to my composer.json, but still nothing happens and DC is unresponsive. :/
So, to summerise; I have both a new and existing setup which have the same problems.
Oh, now I got it working, apparently you also need your launcher on the latest RC19. (I previously had RC18 installed) So, that probably means that if you're experiencing this issue, first check if your launcher is up to date:
$ drupal self-update
Then, if problems persist, make sure you have the latest webflo/drupal-finder:
$ composer require webflo/drupal-finder:^0.3.0
Yes you need the drupal/console:1.0.0-rc19 to work with webflo/drupal-finder:^0.3.0
@ludal74 Well, yeah, otherwise you won't have experienced this error in the first place. 馃檪What I'm saying is that you also need the drupal console _launcher_ at RC19 to fix this.
@nvaken Thx for the precison ! I didn't figured tere was this other module drupal console launcher. It's supposed to be an implicit dependency of an other module because I didn't have to upgrade it. But good to know. Thanks again
Same here, updating to rc19 solves it. Thanks
Tried updating to rc19 and webflo/drupal-finder:^0.3.0 but no luck
Had the same error.
drupal self-update gave me a timeout (possibly firewall related), so I downloaded RC19 from https://drupalconsole.com/installer, put it in /usr/bin/, and it worked again.
DrupalConsole RC20 was tagged. Make sure you update Launcher and Site installation.
None of the above has worked for me. Any drupal command gives:
Fatal error: Call to undefined method DrupalConsoleCoreUtilsDrupalFinder::getVendorDir() in /vendor/drupal/console-core/src/Utils/DrupalFinder.php on line 24
Any other ideas? This is a completely fresh composer installed drupal 8.3.2 site installed an hour ago.
@adamfchs which version of webflo/drupal-finder is loaded on your siste?
Cn you confirm you have latest Launcher and DrupalConsole site installation rc20?
Did the following steps:
drupal self-updatecomposer require webflo/drupal-finder:^0.3.0. Now webflo/drupal-finder is of version 0.3.0composer update drupal/console --with-dependencies. Now console-en, console-core and console are in RC20Now I am getting below error:
[Symfony\Component\Debug\Exception\FatalThrowableError]
Type error: Argument 5 passed to Drupal\Console\Command\Module\UninstallCommand::__construct() must be an instance of Drupal\Console\Extension\Ma
nager, none given
@manoj-apare try rebuilding cache drupal cr all
@jmolivas Great !!! Thanks. After clearing cache its working.
Closing this one. Feel free to re-open if still happening after updating to the latest version.
@jmolivas Still seeing this issue :
drupal/console 1.0.0-rc20 The Drupal CLI. A tool to generate boilerplate code, interact w...
webflo/drupal-finder 0.3.0 Helper class to locate a Drupal installation from a given path.
Drupal 8.3.2
$ fin drupal cr all
[06-Jun-2017 17:03:13 UTC] PHP Fatal error: Uncaught Error: Call to undefined method Drupal\Console\Core\Utils\DrupalFinder::getVendorDir() in /var/www/docroot/vendor/drupal/console-core/src/Utils/DrupalFinder.php:24
Stack trace:
#0 /var/www/docroot/vendor/drupal/console/bin/drupal.php(37): Drupal\Console\Core\Utils\DrupalFinder->locateRoot('/var/www/docroo...')
#1 phar:///usr/local/bin/drupal/src/Utils/Launcher.php(30): include_once('/var/www/docroo...')
#2 phar:///usr/local/bin/drupal/bin/drupal.php(86): Drupal\Console\Launcher\Utils\Launcher->launch('/var/www/docroo...', Object(Composer\Autoload\ClassLoader))
#3 phar:///usr/local/bin/drupal/bin/drupal(3): require('phar:///usr/loc...')
#4 /usr/local/bin/drupal(10): require('phar:///usr/loc...')
#5 {main}
thrown in /var/www/docroot/vendor/drupal/console-core/src/Utils/DrupalFinder.php on line 24
Fatal error: Uncaught Error: Call to undefined method Drupal\Console\Core\Utils\DrupalFinder::getVendorDir() in /var/www/docroot/vendor/drupal/console-core/src/Utils/DrupalFinder.php:24
Stack trace:
#0 /var/www/docroot/vendor/drupal/console/bin/drupal.php(37): Drupal\Console\Core\Utils\DrupalFinder->locateRoot('/var/www/docroo...')
#1 phar:///usr/local/bin/drupal/src/Utils/Launcher.php(30): include_once('/var/www/docroo...')
#2 phar:///usr/local/bin/drupal/bin/drupal.php(86): Drupal\Console\Launcher\Utils\Launcher->launch('/var/www/docroo...', Object(Composer\Autoload\ClassLoader))
#3 phar:///usr/local/bin/drupal/bin/drupal(3): require('phar:///usr/loc...')
#4 /usr/local/bin/drupal(10): require('phar:///usr/loc...')
#5 {main}
thrown in /var/www/docroot/vendor/drupal/console-core/src/Utils/DrupalFinder.php on line 24
@justinlevi
This seems to be an issue with the Drupal Console _Launcher_ not being the same version as Drupal Console itself.
To fix it:
curl https://drupalconsole.com/installer -L -o drupal.phar
sudo mv drupal.phar /usr/local/bin/drupal
chmod +x /usr/local/bin/drupal
Then you can run:
drupal cr all
And you should be up and running again.
Yes indeed, that fixed the glitch.
This seems to be an issue with the Drupal Console Launcher not being the same version as Drupal Console itself.
Maybe this was suggested elsewhere, but we should add a check for that.
This is a issue related to a services file cached.
A better way to handle this is probably to:
cd /to/your/drupal/root/composer.json/directory
composer require drupal/console-launcher
Then it should be updated when you run a general composer update.
My bad this was related tot a diff version of a dependency https://github.com/webflo/drupal-finder
@flatline-studios the launcher is installed globally not per-site.
At this point, we only share one dependency between projects.
@jmolivas
composer global require drupal/console-launcher
I guess is more suitable then. It does just mean remembering to update global packages too though.
@flatline-studios the Launcher provides the self-update command to take care of downloading latest version.
@jmolivas the only problem with that is when ALL drupal <command> throw an error, including the self-update. It's a chicken and egg situation really. Launcher is broken and needs updating, but the self-update command needs a working launcher.
I had the same issue and updating the launcher resolved it. The launcher was initially rc16 while drupal console was rc21.
Thanks @flatline-studios
@flatline-studios, ultimately I was running into the same issue you stated most recently. This fixed it...
https://github.com/hechoendrupal/drupal-console/issues/3212#issuecomment-286011915
I'm running into the same issue with a project just created with: https://github.com/drupal-composer/drupal-project
Not sure if it has something to do that I am using docker!
@flatline-studios try re-installing the launcher again
curl https://drupalconsole.com/installer -L -o drupal.phar
mv drupal.phar /usr/local/bin/drupal
chmod +x /usr/local/bin/drupal
Tried that but same error:
/var/www/html/web $ drupal
[23-Jun-2017 03:56:56 UTC] PHP Fatal error: Uncaught Error: Call to undefined method Drupal\Console\Core\Utils\DrupalFinder::getVendorDir() in /var/www/html/vendor/drupal/console-core/src/Utils/DrupalFinder.php:24
Stack trace:
#0 /var/www/html/vendor/drupal/console/bin/drupal.php(37): Drupal\Console\Core\Utils\DrupalFinder->locateRoot('/var/www/html')
#1 phar:///usr/local/bin/drupal/src/Utils/Launcher.php(30): include_once('/var/www/html/v...')
#2 phar:///usr/local/bin/drupal/bin/drupal.php(86): Drupal\Console\Launcher\Utils\Launcher->launch('/var/www/html', Object(Composer\Autoload\ClassLoader))
#3 phar:///usr/local/bin/drupal/bin/drupal(3): require('phar:///usr/loc...')
#4 /usr/local/bin/drupal(10): require('phar:///usr/loc...')
#5 {main}
thrown in /var/www/html/vendor/drupal/console-core/src/Utils/DrupalFinder.php on line 24
Fatal error: Uncaught Error: Call to undefined method Drupal\Console\Core\Utils\DrupalFinder::getVendorDir() in /var/www/html/vendor/drupal/console-core/src/Utils/DrupalFinder.php on line 24
Error: Call to undefined method Drupal\Console\Core\Utils\DrupalFinder::getVendorDir() in /var/www/html/vendor/drupal/console-core/src/Utils/DrupalFinder.php on line 24
Call Stack:
0.2009 349656 1. {main}() /usr/local/bin/drupal:0
0.2038 810640 2. require('phar:///usr/local/bin/drupal/bin/drupal') /usr/local/bin/drupal:10
0.2045 812128 3. require('phar:///usr/local/bin/drupal/bin/drupal.php') phar:///usr/local/bin/drupal/bin/drupal:3
1.0148 2550736 4. Drupal\Console\Launcher\Utils\Launcher->launch() phar:///usr/local/bin/drupal/bin/drupal.php:86
1.0151 2551288 5. include_once('/var/www/html/vendor/drupal/console/bin/drupal.php') phar:///usr/local/bin/drupal/src/Utils/Launcher.php:30
1.0221 2695984 6. Drupal\Console\Core\Utils\DrupalFinder->locateRoot() /var/www/html/vendor/drupal/console/bin/drupal.php:37
@albertski which version do you have of drupal/console and webflo/drupal-finder? you can check using this:
DrupalConsole
composer show | grep drupal/console
DrupalFinder
composer show | grep drupal-finder
composer show | grep drupal/console
drupal/console 1.0.0-rc19 The Drupal CLI. A tool to generate boilerplate ...
drupal/console-core 1.0.0-rc19 Drupal Console Core
drupal/console-en 1.0.0-rc19 Drupal Console English Language
drupal/console-extend-plugin 0.8.0 Drupal Console Extend Plugin
Alberts-MacBook-Pro:xeno-dashboard albertski$ composer show | grep drupal-finder
webflo/drupal-finder 0.2.1 Helper class to locate a Drupal installation fr.
You need to update drupal/console and webflo/drupal-finder try:
composer update drupal/console --with-dependencies
Tried that but the issue remains:
composer update drupal/console --with-dependencies
1/3: http://packagist.org/p/provider-latest$580b5a14006673e3a16f0220d0d202fc857f832e040dd6c8b1d726424a2abd5c.json
2/3: http://packagist.org/p/provider-2017-01$1b5eeb4d47827e94c1c5e9445d7056136529af5127449e24d2a202f0c1e1b7cd.json
3/3: http://packagist.org/p/provider-2017-04$289e0708fa70892d02f485827d2874bf7eefb0b825f8e6053ffde9cbc5e499b5.json
Finished: success: 3, skipped: 0, failure: 0, total: 3
> DrupalProject\composer\ScriptHandler::checkComposerVersion
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Generating autoload files
> DrupalProject\composer\ScriptHandler::createRequiredFiles
FYI this is part of my composer.json:
"composer/installers": "^1.2",
"cweagans/composer-patches": "^1.6",
"drupal-composer/drupal-scaffold": "^2.2",
"drupal/console": "~1.0",
"drupal/core": "~8.0",
"drupal/jira_rest": "^2.0",
"drush/drush": "~8.0",
"webflo/drupal-finder": "^0.2.1",
"webmozart/path-util": "^2.3"
Part of my composer.lock
{
"name": "drupal/console",
"version": "1.0.0-rc19",
"source": {
"type": "git",
"url": "https://github.com/hechoendrupal/drupal-console.git",
"reference": "98ad4c0362146689f3d4f895394ef35a4f95443d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/hechoendrupal/drupal-console/zipball/98ad4c0362146689f3d4f895394ef35a4f95443d",
"reference": "98ad4c0362146689f3d4f895394ef35a4f95443d",
"shasum": ""
},
"require": {
"alchemy/zippy": "0.4.3",
"composer/installers": "~1.0",
"doctrine/annotations": "1.2.*",
"doctrine/collections": "~1.3",
"drupal/console-core": "1.0.0-rc19",
"drupal/console-extend-plugin": "~0",
"gabordemooij/redbean": "~4.3",
"guzzlehttp/guzzle": "~6.1",
"php": "^5.5.9 || ^7.0",
"psy/psysh": "0.6.* || ~0.8",
"symfony/css-selector": ">=2.7 <3.0",
"symfony/dom-crawler": ">=2.7 <3.3",
"symfony/expression-language": ">=2.7 <3.0",
"symfony/http-foundation": ">=2.7 <3.0"
},
"bin": [
"bin/drupal"
],
"type": "project",
"autoload": {
"psr-4": {
"Drupal\\Console\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"GPL-2.0+"
],
"authors": [
{
"name": "David Flores",
"email": "[email protected]",
"homepage": "http://dmouse.net"
},
{
"name": "Jesus Manuel Olivas",
"email": "[email protected]",
"homepage": "http://jmolivas.com"
},
{
"name": "Drupal Console Contributors",
"homepage": "https://github.com/hechoendrupal/DrupalConsole/graphs/contributors"
},
{
"name": "Eduardo Garcia",
"email": "[email protected]",
"homepage": "http://enzolutions.com/"
},
{
"name": "Omar Aguirre",
"email": "[email protected]"
}
],
"description": "The Drupal CLI. A tool to generate boilerplate code, interact with and debug Drupal.",
"homepage": "http://drupalconsole.com/",
"keywords": [
"console",
"development",
"drupal",
"symfony"
],
"time": "2017-05-08T16:49:07+00:00"
},
You are enforcing "webflo/drupal-finder": "^0.2.1", and you need 0.3.0 as you can see on the project repo https://github.com/drupal-composer/drupal-project/blob/8.x/composer.json#L25 try updating "webflo/drupal-finder": "^0.3.0" and then composer update webflo/drupal-finder
Hmm did that but still having the issue:
{
"name": "drupal/console-core",
"version": "1.0.0-rc21",
"source": {
"type": "git",
"url": "https://github.com/hechoendrupal/drupal-console-core.git",
"reference": "a473a27292110e5f50e0ae8df36d38449ce55903"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/hechoendrupal/drupal-console-core/zipball/a473a27292110e5f50e0ae8df36d38449ce55903",
"reference": "a473a27292110e5f50e0ae8df36d38449ce55903",
"shasum": ""
},
"require": {
"dflydev/dot-access-configuration": "1.0.1",
"drupal/console-en": "1.0.0-rc21",
"php": "^5.5.9 || ^7.0",
"stecman/symfony-console-completion": "~0.7",
"symfony/config": ">=2.7 <3.0",
"symfony/console": ">=2.7 <3.0",
"symfony/debug": ">=2.6 <3.0",
"symfony/dependency-injection": ">=2.7 <3.0",
"symfony/event-dispatcher": ">=2.7 <3.0",
"symfony/filesystem": ">=2.7 <3.0",
"symfony/finder": ">=2.7 <3.0",
"symfony/process": ">=2.7 <3.0",
"symfony/translation": ">=2.7 <3.0",
"symfony/yaml": ">=2.7 <3.0",
"twig/twig": "^1.23.1",
"webflo/drupal-finder": "^0.3.0"
},
"type": "project",
"autoload": {
"files": [
"src/functions.php"
],
"psr-4": {
"Drupal\\Console\\Core\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"GPL-2.0+"
],
"authors": [
{
"name": "David Flores",
"email": "[email protected]",
"homepage": "http://dmouse.net"
},
{
"name": "Jesus Manuel Olivas",
"email": "[email protected]",
"homepage": "http://jmolivas.com"
},
{
"name": "Drupal Console Contributors",
"homepage": "https://github.com/hechoendrupal/DrupalConsole/graphs/contributors"
},
{
"name": "Eduardo Garcia",
"email": "[email protected]",
"homepage": "http://enzolutions.com/"
},
{
"name": "Omar Aguirre",
"email": "[email protected]"
}
],
"description": "Drupal Console Core",
"homepage": "http://drupalconsole.com/",
"keywords": [
"console",
"development",
"drupal",
"symfony"
],
"time": "2017-06-07T15:57:23+00:00"
},
I'm using: PHP 7.1.4
What is the remaining issue?, can you share the error you are getting?
Can you check which version do you have now after the update?
Following instructions at https://github.com/hechoendrupal/drupal-console/issues/3302#issuecomment-310567211
composer show | grep drupal/console
drupal/console 1.0.0-rc21 The Drupal CLI. ...
drupal/console-core 1.0.0-rc21 Drupal Console Core
drupal/console-en 1.0.0-rc21 Drupal Console E...
drupal/console-extend-plugin 0.8.0 Drupal Console E...
composer show | grep drupal-finder
webflo/drupal-finder 0.3.0 Helper class to .
Here is the error:
/var/www/html/web $ drupal
[23-Jun-2017 05:09:16 UTC] PHP Fatal error: Uncaught Error: Call to undefined method Drupal\Console\Core\Utils\DrupalFinder::getVendorDir() in /var/www/html/vendor/drupal/console-core/src/Utils/DrupalFinder.php:24
Stack trace:
#0 /var/www/html/vendor/drupal/console/bin/drupal.php(37): Drupal\Console\Core\Utils\DrupalFinder->locateRoot('/var/www/html')
#1 phar:///usr/local/bin/drupal/src/Utils/Launcher.php(30): include_once('/var/www/html/v...')
#2 phar:///usr/local/bin/drupal/bin/drupal.php(86): Drupal\Console\Launcher\Utils\Launcher->launch('/var/www/html', Object(Composer\Autoload\ClassLoader))
#3 phar:///usr/local/bin/drupal/bin/drupal(3): require('phar:///usr/loc...')
#4 /usr/local/bin/drupal(10): require('phar:///usr/loc...')
#5 {main}
thrown in /var/www/html/vendor/drupal/console-core/src/Utils/DrupalFinder.php on line 24
Fatal error: Uncaught Error: Call to undefined method Drupal\Console\Core\Utils\DrupalFinder::getVendorDir() in /var/www/html/vendor/drupal/console-core/src/Utils/DrupalFinder.php on line 24
Error: Call to undefined method Drupal\Console\Core\Utils\DrupalFinder::getVendorDir() in /var/www/html/vendor/drupal/console-core/src/Utils/DrupalFinder.php on line 24
Call Stack:
0.2029 349656 1. {main}() /usr/local/bin/drupal:0
0.2066 810640 2. require('phar:///usr/local/bin/drupal/bin/drupal') /usr/local/bin/drupal:10
0.2070 812128 3. require('phar:///usr/local/bin/drupal/bin/drupal.php') phar:///usr/local/bin/drupal/bin/drupal:3
1.0443 2550736 4. Drupal\Console\Launcher\Utils\Launcher->launch() phar:///usr/local/bin/drupal/bin/drupal.php:86
1.0446 2551288 5. include_once('/var/www/html/vendor/drupal/console/bin/drupal.php') phar:///usr/local/bin/drupal/src/Utils/Launcher.php:30
1.0522 2695984 6. Drupal\Console\Core\Utils\DrupalFinder->locateRoot() /var/www/html/vendor/drupal/console/bin/drupal.php:37
How about the Launcher? which version do you have installed?
Try cd out of the drupal site and execute drupal --version
Turns out I was on Drupal Console Launcher version 1.0.0-rc16 and when I was running the commands:
mv drupal.phar /usr/local/bin/drupal
chmod +x /usr/local/bin/drupal
It didn't work because I needed to be logged in as root. I logged in as root and ran the commands and it fixed the issue. Thanks a lot for your help!
Glad to read is working now
$ composer update drupal/console --with-dependencies
Dependency "composer/installers" is also a root requirement, but is not explicitly whitelisted. Ignoring.
$ composer show | grep drupal-finder
webflo/drupal-finder 0.2.1 Helper class to locate a Drupal insta...
In composer.json:
"webflo/drupal-finder": "^0.2.1",
I'm having this error also.
composer show | grep drupal/console
drupal/console 1.0.0-rc26 The Drupal CLI. A tool to generate boilerplate code, interact with and debug Drupal.
drupal/console-core 1.0.0-rc26 Drupal Console Core
drupal/console-dotenv 0.3.0 Drupal Console Dotenv
drupal/console-en 1.0.0-rc26 Drupal Console English Language
drupal/console-extend-plugin 0.9.2 Drupal Console Extend Plugin
composer show | grep drupal-finder
webflo/drupal-finder 0.3.0
then I do drupal --version and get this:
PHP Error: Call to undefined method Drupal\Console\Core\Utils\DrupalFinder::getVendorDir() in /home/vendor/drupal/console-core/src/Utils/DrupalFinder.php on line 41
PHP Stack trace:
PHP 1. {main}() /usr/local/bin/drupal:0
PHP 2. require() /usr/local/bin/drupal:10
PHP 3. require() phar:///usr/local/bin/drupal/bin/drupal:3
PHP 4. Drupal\Console\Launcher\Utils\Launcher->launch() phar:///usr/local/bin/drupal/bin/drupal.php:86
PHP 5. include_once() phar:///usr/local/bin/drupal/src/Utils/Launcher.php:30
PHP 6. Drupal\Console\Core\Utils\DrupalFinder->locateRoot() /home/vendor/drupal/console/bin/drupal.php:50
Error: Call to undefined method Drupal\Console\Core\Utils\DrupalFinder::getVendorDir() in /home/vendor/drupal/console-core/src/Utils/DrupalFinder.php on line 41
Call Stack:
0.0003 349320 1. {main}() /usr/local/bin/drupal:0
0.0048 810512 2. require('phar:///usr/local/bin/drupal/bin/drupal') /usr/local/bin/drupal:10
0.0052 831008 3. require('phar:///usr/local/bin/drupal/bin/drupal.php') phar:///usr/local/bin/drupal/bin/drupal:3
0.3655 4641384 4. Drupal\Console\Launcher\Utils\Launcher->launch() phar:///usr/local/bin/drupal/bin/drupal.php:86
0.3658 4658592 5. include_once('/home/vendor/drupal/console/bin/drupal.php') phar:///usr/local/bin/drupal/src/Utils/Launcher.php:30
0.3799 5238984 6. Drupal\Console\Core\Utils\DrupalFinder->locateRoot() /home/vendor/drupal/console/bin/drupal.php:50
PHP Fatal error: Uncaught Error: Call to undefined method Drupal\Console\Core\Utils\DrupalFinder::getVendorDir() in /home/vendor/drupal/console-core/src/Utils/DrupalFinder.php:41
Stack trace:
#0 /home/vendor/drupal/console/bin/drupal.php(50): Drupal\Console\Core\Utils\DrupalFinder->locateRoot('/home/robert/ba...')
#1 phar:///usr/local/bin/drupal/src/Utils/Launcher.php(30): include_once('/home/robert/ba...')
#2 phar:///usr/local/bin/drupal/bin/drupal.php(86): Drupal\Console\Launcher\Utils\Launcher->launch('/home/robert/ba...', Object(Composer\Autoload\ClassLoader))
#3 phar:///usr/local/bin/drupal/bin/drupal(3): require('phar:///usr/loc...')
#4 /usr/local/bin/drupal(10): require('phar:///usr/loc...')
#5 {main}
thrown in /home/vendor/drupal/console-core/src/Utils/DrupalFinder.php on line 41
Fatal error: Uncaught Error: Call to undefined method Drupal\Console\Core\Utils\DrupalFinder::getVendorDir() in /home/vendor/drupal/console-core/src/Utils/DrupalFinder.php on line 41
Error: Call to undefined method Drupal\Console\Core\Utils\DrupalFinder::getVendorDir() in /home/vendor/drupal/console-core/src/Utils/DrupalFinder.php on line 41
Call Stack:
0.0003 349320 1. {main}() /usr/local/bin/drupal:0
0.0048 810512 2. require('phar:///usr/local/bin/drupal/bin/drupal') /usr/local/bin/drupal:10
0.0052 831008 3. require('phar:///usr/local/bin/drupal/bin/drupal.php') phar:///usr/local/bin/drupal/bin/drupal:3
0.3655 4641384 4. Drupal\Console\Launcher\Utils\Launcher->launch() phar:///usr/local/bin/drupal/bin/drupal.php:86
0.3658 4658592 5. include_once('/home/vendor/drupal/console/bin/drupal.php') phar:///usr/local/bin/drupal/src/Utils/Launcher.php:30
0.3799 5238984 6. Drupal\Console\Core\Utils\DrupalFinder->locateRoot() /home/vendor/drupal/console/bin/drupal.php:50
@robertgarrigos Try updating the Launcher aka global executable https://docs.drupalconsole.com/en/getting/launcher.html
thanks @jmolivas that fixed the problem
Most helpful comment
@justinlevi
This seems to be an issue with the Drupal Console _Launcher_ not being the same version as Drupal Console itself.
To fix it:
curl https://drupalconsole.com/installer -L -o drupal.pharsudo mv drupal.phar /usr/local/bin/drupalchmod +x /usr/local/bin/drupalThen you can run:
drupal cr allAnd you should be up and running again.