我在我的环境中使用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

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


当前回答

试试这个,对我有用:

删除目录下所有的vagrants文件 ~# vagrant init——template——force 流浪汉起来了

完成了!

其他回答

我在运行以下命令时也遇到了同样的问题

vagrant init
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: Box file was not detected as metadata. Adding it directly...
==> 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 /home/...../base

我用

>vagrant init laravel/homestead
>Vagrant up

这对我很管用。

快乐的编码

对我来说,这是以下几个步骤:

cd homestead(在您的目录homestead文件夹下)或cd homestead del vagrantfile或rm -Rf vagrantfile 流浪者在laravel/homestead 流浪汉了

这是我在Windows 10上的工作:https://stackoverflow.com/a/31594225/2400373

但使用命令后,需要删除文件:Vagranfile:

vagrant init precise64 http://files.vagrantup.com/precise64.box

之后,

vagrant up

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

vagrant init hashicorp/bionic64

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

Then

vagrant up

当你做vagrant init时,它会替换你的repo中的vagrant文件,并给你这个错误。所以我建议你从远程复制原始的vagrant文件或备份的vagrant文件,然后试试vagrant。

我遇到了同样的问题,我只是从我的远程回购复制了流浪者文件,并替换了我试图运行的流浪者文件。这将使流浪文件中的配置与虚拟机同步。