Laravel Homestead新项目错误

时间:2016-03-15 20:59:07

标签: homestead

在我的Win8机器上,我使用git安装了Laravel Homestead盒子。 (OracleVM +流浪)。

Homestead.yaml

---
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox

authorize: ~/.ssh/id_rsa.pub

keys:
    - ~/.ssh/id_rsa

folders:
    - map: ~/Code
      to: /home/vagrant/Code

sites:
    - map: newProject.local
      to: /home/vagrant/Code/newProject/public

databases:
    - homestead

我使用以下方式启动VM:

cd Homestead
vagrant up
vagrant ssh

一切正常。

如果我理解正确,我仍然需要在我的代码/文件夹中创建一个newProject。

cd Code
composer create-project --prefer-dist laravel/laravel newProject 

如果我在灯服务器上的位置,这将有效,但我得到以下错误:

 You are running composer with xdebug enabled. This has a major impact on runtime performance. See https://getcomposer.org/xdebug
Installing laravel/laravel (v5.2.15)
  - Installing laravel/laravel (v5.2.15)
    Loading from cache

Created project in newProject
> php -r "copy('.env.example', '.env');"
> php artisan clear-compiled
PHP Warning:  require(/home/vagrant/newProject/bootstrap/../vendor/autoload.php): failed to open stream: No such file or directory in /home/vagrant/newProject/bootstrap/autoload.php on line 17
PHP Stack trace:
PHP   1. {main}() /home/vagrant/newProject/artisan:0
PHP   2. require() /home/vagrant/newProject/artisan:16

Warning: require(/home/vagrant/newProject/bootstrap/../vendor/autoload.php): failed to open stream: No such file or directory in /home/vagrant/newProject/bootstrap/autoload.php on line 17

Call Stack:
    0.0001     352008   1. {main}() /home/vagrant/newProject/artisan:0
    0.0001     353760   2. require('/home/vagrant/newProject/bootstrap/autoload.php') /home/vagrant/newProject/artisan:16

PHP Fatal error:  require(): Failed opening required '/home/vagrant/newProject/bootstrap/../vendor/autoload.php' (include_path='.:/usr/share/php:') in /home/vagrant/newProject/bootstrap/autoload.php on line 17
PHP Stack trace:
PHP   1. {main}() /home/vagrant/newProject/artisan:0
PHP   2. require() /home/vagrant/newProject/artisan:16

Fatal error: require(): Failed opening required '/home/vagrant/newProject/bootstrap/../vendor/autoload.php' (include_path='.:/usr/share/php:') in /home/vagrant/newProject/bootstrap/autoload.php on line 17

Call Stack:
    0.0001     352008   1. {main}() /home/vagrant/newProject/artisan:0
    0.0001     353760   2. require('/home/vagrant/newProject/bootstrap/autoload.php') /home/vagrant/newProject/artisan:16

Script php artisan clear-compiled handling the pre-update-cmd event returned with an error


  [RuntimeException]
  Error Output: PHP Warning:  require(/home/vagrant/newProject/bootstrap/../vendor/autoload.php): failed to open stream: No such file or directory in /home/vagrant/newProject/bootstrap/autoload.php on line 17
  PHP Stack trace:
  PHP   1. {main}() /home/vagrant/newProject/artisan:0
  PHP   2. require() /home/vagrant/newProject/artisan:16
  PHP Fatal error:  require(): Failed opening required '/home/vagrant/newProject/bootstrap/../vendor/autoload.php' (include_path='.:/usr/share/php:') in /home/vagrant/newProject/bootstrap/autoload.php on line
   17
  PHP Stack trace:
  PHP   1. {main}() /home/vagrant/newProject/artisan:0
  PHP   2. require() /home/vagrant/newProject/artisan:16

任何想法为什么会发生这种情况? 我试图cp一个工作项目,仍然得到所需的错误。 我发现类似的错误与缺少依赖关系有关,但是Homestead不应该自己处理这些错误吗?

1 个答案:

答案 0 :(得分:0)

看起来这是作曲家的问题。我只是再次尝试,它的工作原理。关于Laravel新闻的更多信息:https://laravel-news.com/2016/03/may-need-update-composer-json-file/