最近在学习yii2.0 一直想用官方推荐的composer来安装 一直不成功 报了一个错误一直在困扰着我
废话少说 直入主题
➜ 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
之后就出现了这个错误。。。。
目前我发现解决这个问题的办法是:
直接编辑yii2-advanced文件夹composer.json文件
vi yii2-advanced/composer.json
然后添加github的授权
将
"config": {"process-timeout": 1800},
改为
"config": {"process-timeout": 1800,"github-oauth": { "github.com": "此处输入您的github授权码" } },
保存文件,运行以下命令即可完成yii2框架的导入
cd yii2-advanced composer update
点击此链接 --> 点击右上角Generate new token --> 在Token description中输入"yii composer install token"
--> 点击Generate token即可创建新的github授权码
Token description中可以随意输入描述
Atas ialah kandungan terperinci yii2使用安装composer出错问题总结. Untuk maklumat lanjut, sila ikut artikel berkaitan lain di laman web China PHP!