linux 使用composer 安装yii2框架报错

使用 composer create-project yiisoft/yii2-app-basic yii2
报下面错误,
Running composer as root/super user is highly discouraged as packages, plugins and scripts cannot always be trusted
Installing yiisoft/yii2-app-basic (2.0.8)

  • Installing yiisoft/yii2-app-basic (2.0.8)
    Loading from cache

Created project in yii2
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

Problem 1

  • yiisoft/yii2 2.0.8 requires bower-asset/jquery 2.2.@stable | 2.1.@stable | 1.11.*@stable -> no matching package found.

  • 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.@stable -> no matching package found.

  • yiisoft/yii2 2.0.5 requires bower-asset/jquery 2.1.@stable | 1.11.@stable -> no matching package found.

  • Installation request for yiisoft/yii2 >=2.0.5 -> satisfiable by yiisoft/yii2[2.0.5, 2.0.6, 2.0.7, 2.0.8].

Potential causes:

Read https://getcomposer.org/doc/articles/troubleshooting.md for further common problems.

登陆的是root权限;
是什么原因,怎么解决;

阅读 7k
2 个回答

yii2使用了composer asset plugin来管理需要的bower和npm模块,在安装之前需要先使用下面命令安装composer asset plugin

composer global require "fxp/composer-asset-plugin:~1.1.1"

然后再

composer create-project yiisoft/yii2-app-basic yii2

即可安装。

碰到过类似情况,怎么换 fxp 版本都不行

从 stackoverflow 里查到的方法,参考以下 github 相关
https://github.com/yidas/yii2... 用于忽略 yii 自带的 bower
https://github.com/yidas/yii2... 用于补上忽略掉的 bower 文件

不过,我公司里怎么都不行,家里试了以下,直接就是好的,莫名其妙 [=.=]

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题