“供应商"运行"Composer Install"后,文件夹丢失 [英] "vendor" folder missing after running "Composer Install"

查看:129
本文介绍了“供应商"运行"Composer Install"后,文件夹丢失的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在尝试在我从Github提取的Laravel应用程序Vagrant/Homestead上运行.我将其连接到数据库,并在该文件夹中运行Composer Install,Composer Update.当我尝试在浏览器上访问它时,出现以下错误:

I am currently trying to run on Vagrant/Homestead a Laravel Application that I pulled from Github. I connected it to the database, and run Composer Install, Composer Update inside the folder. When I try to access to it on the Browser I get the following error:

警告:require(/home/vagrant/.../public/vendor/autoload.php):无法打开流:/home/vagrant/..../public中没有此类文件或目录/autoload.php,第2行

我导航到了vendor文件夹,发现它不是创建的.任何想法如何解决?

I navigated to the vendor folder and noticed that it was not created. Any ideas how to fix it?

该应用程序在Laravel 4中运行,运行Composer Install时,从终端获得以下输出:

The application runs in Laravel 4, and I got the following output from the terminal when I run Composer Install:

Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Nothing to install or update
Package herrera-io/json is abandoned, you should avoid using it. Use kherge/json instead.
Package kherge/version is abandoned, you should avoid using it. No replacement was suggested.
Package herrera-io/phar-update is abandoned, you should avoid using it. No replacement was suggested.
Package mjolnic/bootstrap-colorpicker is abandoned, you should avoid using it. Use itsjavi/bootstrap-colorpicker instead.

生成自动加载文件

php artisan明确编译 PHP的工匠优化 生成优化的类加载器

php artisan clear-compiled php artisan optimize Generating optimized class loader

有什么想法吗?

推荐答案

Composer需要从应用程序的根目录运行,即不必从public文件夹运行,这似乎表明您的错误.

Composer needs to be run from the root of your application, i.e. not from the public folder as your error seems to indicate.

您可以先尝试运行:

composer install --no-scripts

此命令应列出正在下载和安装的软件包.如果以上方法均有效,则可以运行:

This command should list the packages that are being downloaded and installed. If the above works, you can then run:

php artisan optimize

这将创建Laravel将使用的autoload.php文件.

This will create the autoload.php file that Laravel will use.

这篇关于“供应商"运行"Composer Install"后,文件夹丢失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆