YII2 update vendor error

简介:

今天周六,在家安装yii2的advanced版本, 过程有些坎坷, 不过最后总算安装好了.

总结一下, 主要遇到下面两个问题:

1, 下载速度慢, 主要原因是网络问题

下载yii2时, 模板(除了vendor之外的文件夹和文件)一般会很快下载下来,

但是vendor文件夹下都是yii2依赖的包, 这些包好像都存放在国外的github上, 所以下载会很慢, 有时甚至下载不下来.

这个比较好解决, 方法一: FANQIANG, 方法baidu或者google即可. 方法二: 采用国内的镜像.

第二种方法更可靠, 而且指定镜像也很简单, 具体可参考Composer中国全量镜像http://pkg.phpcomposer.com/

官方说明. 在这里写出来吧, 一条命令就可以: composer config -g repo.packagist composer https://packagist.phpcomposer.

这条命令就会修改composer主文件夹下面的config.json文件, 将配置信息写进去.

如果你想知道composer主文件夹安装在哪儿, 可以执行composer config -l -g这条命令, 然后查看home信息,

当然这条命令还可以查看其它配置信息.

2, 速度没有问题, 执行安装命令后, 发现文件夹下面只有模板文件没有vendor

composer提示:

Your requirements could not be resolved to an installable set of packages.

Problem 1
- yiisoft/yii2 2.0.7 requires bower-asset/jquery 2.2.*@stable | 2.1.*@stable
| 1.11.*@stable -> no matching package found.
- yiisoft/yii2 2.0.6 requires bower-asset/jquery 2.1.*@stable | 1.11.*@stabl
e -> no matching package found.
- Installation request for yiisoft/yii2 >=2.0.6 -> satisfiable by yiisoft/yi
i2[2.0.6, 2.0.7].

Potential causes:
- A typo in the package name
- The package is not available in a stable-enough version according to your min
imum-stability setting
see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more det
ails.

Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further commo
n problems.

上面的提示信息中其实并没有很明确的指出问题出现在哪儿, 但是它给出了两个潜在的原因:

  - 1, package name包名输入错误, 具体是哪个包名错误没有说明, 这个信息不太靠谱.

  - 2, 这条信息比较有用, 大意是composer根据现有的配置在现有版本下无法获取到包,

  可以猜测下, 大概是composer需要update或者插件需要更新了.

于是执行composer self-update更新composer, 然后再接着composer update拉包,但是仍是提示上面的错误.

那就接着更新(安装)插件, 在这个网站下https://packagist.org/packages/fxp/composer-asset-plugin可以看到

composer-asset-plugin的最新版本, 然后执行composer global require "fxp/composer-asset-plugin:~1.1.2"

我安装时最新版本为1.1.2, 可以根据官网的版本更新来做相应更改.这条命令会将插件安装到composer主文件夹下的vendor

文件夹下面, 并在主文件夹下的composer.json写入配置信息.

解决了上面两个问题, 总算将yii2安装成功.

总结:

yii2安装问题不是很多, 遇到问题先要找到原因, 多看下yii官网的下载或者安装指南, 然后多百度或者google.



本文转自 liang3391 51CTO博客,原文链接:http://blog.51cto.com/liang3391/1853237
相关文章
|
iOS开发
解决App Installation failed, No code signature found.
解决App Installation failed, No code signature found.
367 0
|
运维 JavaScript jenkins
uni-app命令行构建Module parse failed:Unexpected token错误处理
分享一次打包环境升级导致的jenkins部署流程失败问题的解决过程。
1648 0
|
3月前
|
JavaScript Linux Windows
【应用服务 App Service】NodeJS +Egg 发布到App Service时遇见 [ERR_SYSTEM_ERROR]: A system error occurred:uv_os_get_passwd returned ENOENT(no such file or directory)
【应用服务 App Service】NodeJS +Egg 发布到App Service时遇见 [ERR_SYSTEM_ERROR]: A system error occurred:uv_os_get_passwd returned ENOENT(no such file or directory)
|
6月前
|
Java 数据库 索引
GreenDao,clearIdentityScope报错Error:Execution failed for task ':app:compileDebugJavaWithJavac'. > Com
GreenDao,clearIdentityScope报错Error:Execution failed for task ':app:compileDebugJavaWithJavac'. > Com
48 1
thinkphp报错Call to undefined method app\index\controller\Index::fetch()
thinkphp报错Call to undefined method app\index\controller\Index::fetch()
165 0
|
缓存 PHP 开发工具
Composer 更新时报错:PHP Fatal error: composerRequireac6b4…(): Failed opening required ‘…/src/helpers.php
Composer 更新时报错:PHP Fatal error: composerRequireac6b4…(): Failed opening required ‘…/src/helpers.php
219 0
Composer 更新时报错:PHP Fatal error:  composerRequireac6b4…(): Failed opening required ‘…/src/helpers.php
|
缓存 PHP
Composer报错: Failed to execute (9) unzip -qq -o “D:\Code/vendor/composer/tmp-d44ec330d383e320b9a78bfc
Composer报错: Failed to execute (9) unzip -qq -o “D:\Code/vendor/composer/tmp-d44ec330d383e320b9a78bfc
212 0
Composer报错: Failed to execute (9) unzip -qq -o “D:\Code/vendor/composer/tmp-d44ec330d383e320b9a78bfc
|
测试技术 PHP
PHP:laravel自定义Model报错:$table must not be defined/$table must be string
PHP:laravel自定义Model报错:$table must not be defined/$table must be string
145 0
|
PHP
【laravel报错】You don‘t have permission to access /laravel/public/index.php on this server.
【laravel报错】You don‘t have permission to access /laravel/public/index.php on this server.
119 0
【laravel报错】You don‘t have permission to access /laravel/public/index.php on this server.
|
PHP
【laravel报错】ErrorException : include(/Users/blihou/Code/jz-exam/vendor/composer/../dingo/blueprint/s
【laravel报错】ErrorException : include(/Users/blihou/Code/jz-exam/vendor/composer/../dingo/blueprint/s
118 0
【laravel报错】ErrorException : include(/Users/blihou/Code/jz-exam/vendor/composer/../dingo/blueprint/s