duanmu2013 2018-02-02 06:17
浏览 105

vagrant reload --provision是错误的说运行作曲家为“root”,我该怎么办?

I used vagrant reload --provision, it says:

==> homestead-7: Attempting graceful shutdown of VM...
==> homestead-7: Checking if box 'laravel/homestead' is up to date...
==> homestead-7: Clearing any previously set forwarded ports...
==> homestead-7: Fixed port collision for 80 => 8000. Now on port 2200.
==> homestead-7: Clearing any previously set network interfaces...
==> homestead-7: Preparing network interfaces based on configuration...
    homestead-7: Adapter 1: nat
    homestead-7: Adapter 2: hostonly
==> homestead-7: Forwarding ports...
    homestead-7: 80 (guest) => 2200 (host) (adapter 1)
    homestead-7: 443 (guest) => 44300 (host) (adapter 1)
    homestead-7: 3306 (guest) => 33060 (host) (adapter 1)
    homestead-7: 4040 (guest) => 4040 (host) (adapter 1)
    homestead-7: 5432 (guest) => 54320 (host) (adapter 1)
    homestead-7: 8025 (guest) => 8025 (host) (adapter 1)
    homestead-7: 27017 (guest) => 27017 (host) (adapter 1)
    homestead-7: 22 (guest) => 2222 (host) (adapter 1)
==> homestead-7: Running 'pre-boot' VM customizations...
==> homestead-7: Booting VM...
==> homestead-7: Waiting for machine to boot. This may take a few minutes...
    homestead-7: SSH address: 127.0.0.1:2222
    homestead-7: SSH username: vagrant
    homestead-7: SSH auth method: private key
    homestead-7: Warning: Connection reset. Retrying...
    homestead-7: Warning: Remote connection disconnect. Retrying...
    homestead-7: Warning: Connection reset. Retrying...
    homestead-7: Warning: Remote connection disconnect. Retrying...
    homestead-7: Warning: Connection reset. Retrying...
    homestead-7: Warning: Remote connection disconnect. Retrying...
==> homestead-7: Machine booted and ready!
==> homestead-7: Checking for guest additions in VM...
    homestead-7: The guest additions on this VM do not match the installed version of
    homestead-7: VirtualBox! In most cases this is fine, but in rare cases it can
    homestead-7: prevent things such as shared folders from working properly. If you see
    homestead-7: shared folder errors, please make sure the guest additions within the
    homestead-7: virtual machine match the version of VirtualBox you have installed on
    homestead-7: your host and reload your VM.
    homestead-7: 
    homestead-7: Guest Additions Version: 5.0.18_Ubuntu r106667
    homestead-7: VirtualBox Version: 5.2
==> homestead-7: Setting hostname...
==> homestead-7: Configuring and enabling network interfaces...
==> homestead-7: Mounting shared folders...
    homestead-7: /vagrant => /Users/imchess/Homestead
    homestead-7: /home/vagrant/code => /www/Code/php
==> homestead-7: Running provisioner: file...
==> homestead-7: Running provisioner: shell...
    homestead-7: Running: inline script
==> homestead-7: Running provisioner: shell...
    homestead-7: Running: inline script
==> homestead-7: Running provisioner: shell...
    homestead-7: Running: inline script
==> homestead-7: Running provisioner: shell...
    homestead-7: Running: /var/folders/hq/czdzwx2n1c3_mzsf4vfwm8gm0000gn/T/vagrant-shell20180202-16576-1j9ra42.sh
==> homestead-7: Running provisioner: shell...
    homestead-7: Running: script: Creating Certificate: mwboom.local
==> homestead-7: Running provisioner: shell...
    homestead-7: Running: script: Creating Site: mwboom.local
==> homestead-7: Running provisioner: shell...
    homestead-7: Running: inline script
==> homestead-7: Running provisioner: shell...
    homestead-7: Running: script: Checking for old Schedule
==> homestead-7: Running provisioner: shell...
    homestead-7: Running: script: Creating Certificate: slboom.local
==> homestead-7: Running provisioner: shell...
    homestead-7: Running: script: Creating Site: slboom.local
==> homestead-7: Running provisioner: shell...
    homestead-7: Running: inline script
==> homestead-7: Running provisioner: shell...
    homestead-7: Running: script: Checking for old Schedule
==> homestead-7: Running provisioner: shell...
    homestead-7: Running: script: Clear Variables
==> homestead-7: Running provisioner: shell...
    homestead-7: Running: script: Restarting Cron
==> homestead-7: Running provisioner: shell...
    homestead-7: Running: script: Restarting Nginx
==> homestead-7: Running provisioner: shell...
    homestead-7: Running: script: Creating MySQL Database: homestead
==> homestead-7: Running provisioner: shell...
    homestead-7: Running: script: Creating Postgres Database: homestead
==> homestead-7: Running provisioner: shell...
    homestead-7: Running: script: Update Composer
    homestead-7: You are running composer as "root", while "/home/vagrant/.composer" is owned by "vagrant"
    homestead-7: You are already using composer version 1.6.3 (stable channel).
==> homestead-7: Running provisioner: shell...
    homestead-7: Running: /var/folders/hq/czdzwx2n1c3_mzsf4vfwm8gm0000gn/T/vagrant-shell20180202-16576-17qinoh.sh
==> homestead-7: Running provisioner: shell...
    homestead-7: Running: /var/folders/hq/czdzwx2n1c3_mzsf4vfwm8gm0000gn/T/vagrant-shell20180202-16576-i3q6nl.sh

In this report,

homestead-7: You are running composer as "root", while "/home/vagrant/.composer" is owned by "vagrant"
homestead-7: You are already using composer version 1.6.3 (stable channel).

is red, like an error message.

This is the picture:

picture

So how can I fix this error message?

  • 写回答

2条回答 默认 最新

  • doupai8095 2018-05-29 07:48
    关注

    I'm a real newbie at this, but here is what I found.

    First, this article explains the root issue (forgive the pun): https://snipe.net/2017/11/15/so-you-ran-composer-as-root/

    To fix the issue, I went to Terminal, to my user's top-level folder and ran "rm .composer" to remove the .composer folder that I had previously installed.

    After that, I ran "vagrant halt" and "vagrant up" and the error message was gone, and my site ran properly.

    评论

报告相同问题?

悬赏问题

  • ¥15 回答4f系统的像差计算
  • ¥15 java如何提取出pdf里的文字?
  • ¥100 求三轴之间相互配合画圆以及直线的算法
  • ¥100 c语言,请帮蒟蒻写一个题的范例作参考
  • ¥15 名为“Product”的列已属于此 DataTable
  • ¥15 安卓adb backup备份应用数据失败
  • ¥15 eclipse运行项目时遇到的问题
  • ¥15 关于#c##的问题:最近需要用CAT工具Trados进行一些开发
  • ¥15 南大pa1 小游戏没有界面,并且报了如下错误,尝试过换显卡驱动,但是好像不行
  • ¥15 自己瞎改改,结果现在又运行不了了