Home  >  Article  >  Backend Development  >  Summary of errors when using yii2 to install composer

Summary of errors when using yii2 to install composer

巴扎黑
巴扎黑Original
2017-06-23 11:35:121778browse

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

The error reported by the terminal:

➜ 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] [- -] [] [] []

Problem description: Enter in the terminal

composer create-project yiisoft/yii2-app-advanced yii2-advanced --prefer-dist
This error occurred after. . . .

Solution:

Currently I found the solution to this problem is:

Directly edit the yii2-advanced folder

composer.jsonFile##

vi yii2-advanced/composer.json

Then add github authorization

Change

"config": {"process-timeout": 1800},

to
"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 update

How 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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn