Php 我能';t在ubuntu上运行artisan命令

Php 我能';t在ubuntu上运行artisan命令,php,laravel,ubuntu,laravel-artisan,Php,Laravel,Ubuntu,Laravel Artisan,我最近从windows迁移到Ubuntu,我安装了php7、mysql、composer,还通过composer global require“laravel/installer”安装了laravel。但当我尝试运行如下命令:php artisan serve时,它给了我以下错误: PHP警告: 需要(/home/slim/Desktop/ss/hh/bootstrap/。/vendor/autoload.php): 无法打开流:中没有此类文件或目录 /第17行的home/slim/Deskto

我最近从windows迁移到Ubuntu,我安装了php7、mysql、composer,还通过
composer global require“laravel/installer”
安装了laravel。但当我尝试运行如下命令:
php artisan serve
时,它给了我以下错误:

PHP警告: 需要(/home/slim/Desktop/ss/hh/bootstrap/。/vendor/autoload.php): 无法打开流:中没有此类文件或目录 /第17行的home/slim/Desktop/ss/hh/bootstrap/autoload.php 错误:require():无法打开required “/home/slim/Desktop/ss/hh/bootstrap/。/vendor/autoload.php” (包括路径='。:/usr/share/php')在 /第17行的home/slim/Desktop/ss/hh/bootstrap/autoload.php


您是否运行composer更新?如果您从存储库中克隆它,它将不包括供应商目录,因此将导致此错误。

我认为您需要更新您的
编写器

composer update

清除缓存后,请执行以下操作:

php artisan config:cache
php artisan config:clear
php artisan cache:clear

我发现此错误仅在laravel的新版本5+上显示,当我创建一个4+laravel项目时,它没有显示此错误

此问题可能是由于编写器尝试在中安装过时的包/插件时发生冲突造成的

尝试删除“composer.json”中未使用的包/插件。例如,mine在安装“werneckbh/qr码”时遇到问题。然后,编辑“composer.json”,删除“werneckbh/qr代码”的条目

保存,然后运行composer安装/composer更新

希望能有帮助


当我尝试运行这些命令的任何命令时,都会出现相同的错误
php artisan config:cache
php artisan config:clear
php artisan cache:clear