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

Summary of errors when using yii2 to install composer

巴扎黑
Release: 2023-03-11 07:26:01
Original
1811 people have browsed it

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
Copy after login
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
Copy after login

Then add github authorization

Change

"config": {"process-timeout": 1800},
Copy after login

to
"config": {"process-timeout": 1800,"github-oauth": {          "github.com": "此处输入您的github授权码"  }
    },
Copy after login

to save the file and run the following command: Can complete the import of yii2 framework
cd yii2-advanced
composer update
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template