当前位置:Gxlcms > PHP教程 > 已经安装'laravel/homestead'box,但是执行homesteadup时提示找不到box,怎么办?

已经安装'laravel/homestead'box,但是执行homesteadup时提示找不到box,怎么办?

时间:2021-07-01 10:21:17 帮助过:6人阅读

已经安装'laravel/homestead' box (0.4.1),但是执行homestead up时提示找不到box,还自动要下载0.3.0版本的box。怎么办?

代码如下:

  1. <code>➜ ~ homestead up
  2. Bringing machine 'default' up with 'virtualbox' provider...
  3. ==> default: Box 'laravel/homestead' could not be found. Attempting to find and install...
  4. default: Box Provider: virtualbox
  5. default: Box Version: <= 0.3.0
  6. </code>

已安装:

  1. <code>➜ ~ vagrant box list
  2. laravel/homestead (virtualbox, 0.4.1)
  3. </code>

vagrant up可以正常启动

  1. <code>➜ ~ vagrant up
  2. Bringing machine 'default' up with 'virtualbox' provider...
  3. ==> default: Checking if box 'laravel/homestead' is up to date...
  4. ==> default: Clearing any previously set forwarded ports...
  5. ==> default: Clearing any previously set network interfaces...
  6. ==> default: Preparing network interfaces based on configuration...
  7. default: Adapter 1: nat
  8. ==> default: Forwarding ports...
  9. default: 22 (guest) => 2222 (host) (adapter 1)
  10. ==> default: Booting VM...
  11. ==> default: Waiting for machine to boot. This may take a few minutes...
  12. default: SSH address: 127.0.0.1:2222
  13. default: SSH username: vagrant
  14. default: SSH auth method: private key
  15. ==> default: Machine booted and ready!
  16. ==> default: Checking for guest additions in VM...
  17. ==> default: Mounting shared folders...
  18. default: /vagrant => /Users/zyy
  19. ==> default: Machine already provisioned. Run `vagrant provision` or use the `--provision`
  20. ==> default: flag to force provisioning. Provisioners marked to run always will still run.</code>

回复内容:

已经安装'laravel/homestead' box (0.4.1),但是执行homestead up时提示找不到box,还自动要下载0.3.0版本的box。怎么办?

代码如下:

  1. <code>➜ ~ homestead up
  2. Bringing machine 'default' up with 'virtualbox' provider...
  3. ==> default: Box 'laravel/homestead' could not be found. Attempting to find and install...
  4. default: Box Provider: virtualbox
  5. default: Box Version: <= 0.3.0
  6. </code>

已安装:

  1. <code>➜ ~ vagrant box list
  2. laravel/homestead (virtualbox, 0.4.1)
  3. </code>

vagrant up可以正常启动

  1. <code>➜ ~ vagrant up
  2. Bringing machine 'default' up with 'virtualbox' provider...
  3. ==> default: Checking if box 'laravel/homestead' is up to date...
  4. ==> default: Clearing any previously set forwarded ports...
  5. ==> default: Clearing any previously set network interfaces...
  6. ==> default: Preparing network interfaces based on configuration...
  7. default: Adapter 1: nat
  8. ==> default: Forwarding ports...
  9. default: 22 (guest) => 2222 (host) (adapter 1)
  10. ==> default: Booting VM...
  11. ==> default: Waiting for machine to boot. This may take a few minutes...
  12. default: SSH address: 127.0.0.1:2222
  13. default: SSH username: vagrant
  14. default: SSH auth method: private key
  15. ==> default: Machine booted and ready!
  16. ==> default: Checking for guest additions in VM...
  17. ==> default: Mounting shared folders...
  18. default: /vagrant => /Users/zyy
  19. ==> default: Machine already provisioned. Run `vagrant provision` or use the `--provision`
  20. ==> default: flag to force provisioning. Provisioners marked to run always will still run.</code>

打开homestead.rb文件 把
config.vm.box_version = settings["version"] ||= ">= 0.4.0" 改为 config.vm.box_version = settings["version"] ||= ">= 0"

Homestead\scripts\文件夹中,打开homestead.rb文件

修改config.vm.box_version = settings["version"] ||= ">= 0.4.0"

人气教程排行