PHP Artisan tinker Class 'XdgBaseDir\Xdg' not found

Viewed 833

I encountered and error when running php artisan tinker in my current project. I tried to create a new project using laravel new projectname but the same error occurs when running php artisan tinker. This is the error that occurs.


````Class 'XdgBaseDir\Xdg' not found

````at C:\xampppp\htdocs\someProject\vendor\psy\psysh\src\ConfigPaths.php:34
  ````30|      * @return string[]
  ````31|      */
  ````32|     public static function getConfigDirs()
  ````33|     {
````> 34|         $xdg = new Xdg();
  ````35|
  ````36|         return self::getDirNames($xdg->getConfigDirs());
  ````37|     }
  ````38|

````1   C:\xampppp\htdocs\someProject\vendor\psy\psysh\src\ConfigPaths.php:90
    ````Psy\ConfigPaths::getConfigDirs()

````2   C:\xampppp\htdocs\someProject\vendor\psy\psysh\src\Configuration.php:392
    ````Psy\ConfigPaths::getConfigFiles()
 

I badly need help. Thank you so much for anyone that knows the solution.
3 Answers

Finally found the solution. I ask my senior if I can copy his vendor files and a composer update followed. What a relief. Thank you still. Peace out!

(Edit)

If you have a working vendor files, you can copy and paste it to the project files folder where you encounter the said error above. Then do a composer update and your all set.

try this one it worked for me probably you don't have the package installed in the vendor

composer require dnoegel/php-xdg-base-dir

Related