如何强制安装软件包? [英] How to force a package to be installed?

查看:1088
本文介绍了如何强制安装软件包?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试通过composer安装以下软件包:

I'm trying to install the following package through composer:

https://packagist.org/packages/cartalyst/sentry# dev-feature/laravel-5

当我这样做时:

composer require cartalyst/sentry dev-feature/laravel-5

我总是会收到此错误:

[InvalidArgumentException]
Could not find package dev-feature/laravel-5 at any version for your minimum-stability (stable). Check the package spelling or your minimum-stability

如果我将minimum-stability更改为dev,它仍然会抱怨.

If I change minimum-stability to dev it will still complain.

但是,如果我安装了dev-master并手动将dev-feature/laravel-5中的文件合并到dev-master中,则可以正常工作.

However, if I install dev-master and manually merge the files from dev-feature/laravel-5 into dev-master, it works fine.

因此,我问为什么要强制通过composer安装此软件包.

Hence why I'm asking how to force this package to be installed via composer.

推荐答案

为强制安装此软件包,我在composer.jsonrequire元素中添加了以下内容:

To force the installation of this package, I added the following to the require element of composer.json:

"cartalyst/sentry":"dev-feature/laravel-5 as 2.1.4"

下面是我找到此建议的链接:

Below is the link from where I found this suggestion:

http://vvv.tobiassjosten.net/php/有composer使用开发分支/

它不能从命令行运行,必须通过composer.json.我不知道为什么.

It will not work from the command line, must be through composer.json. That I don't know why.

更新:

我相信我在上面的最后一条语句中写错了,实际上,类似以下内容的内容可以从命令行运行:

I believe I was wrong in my last statement above, actually something like the following will work from the command line:

composer require "codeception/codeception":"2.1.0-rc1 as 2.0.9"

这篇关于如何强制安装软件包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆