使用 composer 安装 Asana

Asana Installation using composer

我正在尝试通过作曲家安装 asana 库。

Json:

"asana/asana": "^0.10.0" added to composer.json and {
            "name": "asana/asana",
            "description": "A PHP client for the Asana API",
            "type": "library",
            "keywords": ["asana", "client"],
            "homepage": "https://github.com/Asana/php-asana",
            "license": "MIT",
            "require": {
                "php": ">=5.4.0",
                "nategood/httpful": "~0.2",
                "adoy/oauth2": "^1.2.0"
            },
            "require-dev": {
                "instaclick/php-code-sniffer": "dev-master",
                "phpunit/phpunit": "^9"
            },
            "autoload": {
                "psr-0": {
                    "Asana\": "src/"
                }
            }
        }

到 composer.lock 但出现错误“包 Asana/asana 没有定义版本。 '

根据@Jeto 的建议,您不应手动编辑 composer.lock。要安装库,您可以按照官方文档here中提到的步骤进行操作。 假设您正在进行全新安装,请按照以下步骤操作:

  1. 将“asana/asana”包作为依赖项放入您的 composer.json 文件中:
{
    "require": {
        "asana/asana": "^0.10.0"
    }
}
  1. 现在运行命令composer install

composer.lock安装成功后Composer会自动更新文件

编辑:

正如@Jeto 在评论中提到的,您只需使用一个命令即可完成此操作:composer require asana/asana:^0.10.0