我该如何解决laravel项目安装问题?

时间:2020-01-30 12:49:13

标签: laravel

当我尝试在htdocs文件夹中安装新项目时,出现此错误:

[Composer \ Repository \ InvalidRepositoryException]无效的存储库 C:\ xampp \ htdocs / vendor / composer / installed.json中的数据,程序包可以 无法加载:[Seld \ Json Lint \ ParsingException] “ C:\ xampp \ htdocs / vendor / composer / installed.json”不包含 第1行的有效JSON Parse错误:

\\\\\\\\\\\\ ^ ^预期之一:“ STRING”,“ NUMBER”,“ NULL”, 'TRUE','FALSE','{','['

我的安装命令是:

composer create-project --prefer-dist laravel/laravel CruiseBag "5.6.*"

2 个答案:

答案 0 :(得分:1)

在Windows上安装Laravel

  1. 下载Composer的Windows .exe安装程序: https://getcomposer.org/download/
  2. 运行安装程序
  3. 打开窗口的CMD或PowerShell

    cd C:\ xampp \ htdocs

  4. 使用Composer安装Laravel

    composer create-project --prefer-dist laravel / laravel CruiseBag“ 5.6”

See

答案 1 :(得分:1)

// first composer download, then composer install
// Or command use: 
composer global require "laravel/installer"

 //then 
composer create-project --prefer-dist laravel/laravel blog "5.6.*"