1. 程式人生 > >Yii2之yii2-apidoc安裝爆Your requirements could not be resolved to an installable set of packages.的解決方案

Yii2之yii2-apidoc安裝爆Your requirements could not be resolved to an installable set of packages.的解決方案

使用composer安裝yii2-apidoc包時曝出Your requirements could not be resolved to an installable set of packages.的錯誤。因為使用的是composer的中國映象,取消映象,使用VPN,依然是有這個錯誤。後來換了種安裝方式,解決問題。之前安裝使用的是composer require --prefer-dist yiisoft/yii2-apidoc這個指令,現在不使用這個指令。直接在專案composer.json檔案中require增加"yiisoft/yii2-apidoc": "~2.0.0",然後執行composer update

,恢復使用中國映象,安裝很快完成。