我在我的环境中使用Vagrant,我遇到了一个小问题:

$vagrant up

Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'base' could not be found. Attempting to find and install...
    default: Box Provider: virtualbox
    default: Box Version: >= 0
==> default: Adding box 'base' (v0) for provider: virtualbox
    default: Downloading: base

An error occurred while downloading the remote file. The error
message, if any, is reproduced below. Please fix this error and try
again.

Couldn't open file /Users/.../base

我已经初始化了我的项目与流浪者初始化,但出于某种原因流浪者拒绝工作。


当前回答

如果“Vagrantfile”已经在这个目录中存在。在运行“vagrant init”之前删除它。 错误显示

1. rm Vagrantfile
2. vagrant init hashicorp/precise64
3. vagrant up

其他回答

发生这种情况是因为有一个没有定义框名的流浪文件。这种情况发生在你运行vagrant init时不带框名参数。

所以你必须删除流浪者的文件

vagrant init box-title
vagrant up

我希望这能有所帮助!

请在你的终端上运行:

$ vagrant box list

您将看到类似laravel/homestead(virtualbox,x.x.x)的内容。

接下来找到你的Vagrantfile,找到上面写着的那行

config.vm.box = "box"

运行流浪箱列表时,将箱替换为箱名。

我已经在命令行中解决了这个问题。首先更改目录到您的vagrant文件位置,然后init vagrant:

vagrant init hashicorp/bionic64

! 你需要删除旧的Vagrant文件。

Then

vagrant up

如果您添加了一个方框并开始下载,但中断了下载,请转到~/.vagrant。删除部分下载文件,然后重试。

vagrant init laravel/homestead

然后

vagrant up

这对我很有效。