我正在尝试首次安装Laravel(使用VirtualBox和Homestead)。每次我运行以下命令将Laravel安装在“ laravel-basics”文件夹中:
“ composer create-project --prefer-dist laravel / laravel laravel-basics”
我收到以下错误:
“ mkdir():协议错误”
我认为这与我使用的文件夹有关。当我尝试在Homestead / Sites文件夹中安装Laravel(运行Homestead后)时,出现上述错误。当我将Laravel直接安装在Homestead文件夹中时(同样,在运行Homestead之后),一切似乎都可以正常工作。但是问题是,homestead.yaml中的文件路径和Laravel的安装文件夹不再相同。
这是我在homestead.yaml文件中使用的代码:
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox
authorize: ~/.ssh/id_rsa.pub
keys:
- ~/.ssh/id_rsa
folders:
- map: /Users/thomasvanwinsen/Sites
to: /home/vagrant/Sites
sites:
- map: homestead.test
to: /home/vagrant/Sites/laravel-basics/public
databases:
- homestead
这是我在终端机中收到的错误消息:
vagrant@homestead:~/Sites$ composer create-project --prefer-dist laravel/laravel laravel-basics
Installing laravel/laravel (v5.8.3)
[ErrorException]
mkdir(): Protocol error
create-project [-s|--stability STABILITY] [--prefer-source] [--prefer-dist] [--repository REPOSITORY] [--repository-url REPOSITORY-URL] [--dev] [--no-dev] [--no-custom-installers] [--no-scripts] [--no-progress] [--no-secure-http] [--keep-vcs] [--remove-vcs] [--no-install] [--ignore-platform-reqs] [--] [<package>] [<directory>] [<version>]
vagrant@homestead:~/Sites$
如果我运行此命令,Laravel似乎安装正确(但文件路径错误):
vagrant@homestead:~$ composer create-project --prefer-dist laravel/laravel laravel-basics
好吧,我希望我的问题很清楚,有人可以帮助我解决这个问题!已经非常感谢;)