Home >Backend Development >PHP Tutorial >Summary of errors when using yii2 to install composer
I have been learning yii2.0 recently and have always wanted to use the officially recommended composer to install it. It has been unsuccessful and an error has been reported that has been bothering me
No nonsense Let’s go straight to the topic
➜ Yii2.0 composer create-project yiisoft/yii2 -app-advanced yii2-advanced --prefer-dist
Installing yiisoft/yii2-app-advanced (2.0.12)
- Installing yiisoft/yii2-app-advanced (2.0.12): Downloading (100% )
Created project in yii2-advanced
Loading composer repositories with package information
Updating dependencies (including require-dev)
##[Composer\Repository\InvalidRepositoryException] ## No valid bower.json was found in any branch or tag of , could not load a package from it.
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] [--no-install] [--ignore-platform-reqs] [- -] [
composer create-project yiisoft/yii2-app-advanced yii2-advanced --prefer-dist
Directly edit the yii2-advanced folder
composer.jsonFile##vi yii2-advanced/composer.json
Change
"config": {"process-timeout": 1800},
"config": {"process-timeout": 1800,"github-oauth": { "github.com": "此处输入您的github授权码" } },to save the file and run the following command: Can complete the import of yii2 framework
cd yii2-advanced composer updateHow to obtain the authorization code of github? ?
Click this link --> Click Generate new token in the upper right corner --> Enter "yii composer install token" in the Token description
--> Click Generate token to create a new github authorization code
You can enter any description
in the Token description.
The above is the detailed content of Summary of errors when using yii2 to install composer. For more information, please follow other related articles on the PHP Chinese website!