linux 使用composer 安装yii2框架报错

 郭恭彦_522 发布于 2022-11-01 01:57

使用 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权限;
是什么原因,怎么解决;

1 个回答
  • 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

    即可安装。

    2022-11-01 05:56 回答
撰写答案
今天,你开发时遇到什么问题呢?
立即提问
热门标签
PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有