- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试安装PHPUnit进入Laravel框架通过 Composer 。
问题是运行composer update后没有下载所需的文件。
我的流程如下所示:
首先,我在 composer.json
中插入 PHPUnit 要求。整个文件如下所示:
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"require": {
"laravel/framework": "4.1.*",
"laravelbook/ardent": "dev-master",
"phpunit/phpunit": "4.2.*" // i have also tried with 3.7 and 3.8
},
"autoload": {
"classmap": [
"app/commands",
"app/controllers",
"app/models",
"app/database/migrations",
"app/database/seeds",
"app/tests/TestCase.php",
"app/filters"
]
},
"scripts": {
"post-install-cmd": [
"php artisan clear-compiled",
"php artisan optimize"
],
"post-update-cmd": [
"php artisan clear-compiled",
"php artisan optimize"
],
"post-create-project-cmd": [
"php artisan key:generate"
]
},
"config": {
"preferred-install": "dist"
},
"minimum-stability": "stable",
"require": {
"laravelbook/ardent": "dev-master"
}
}
接下来,我运行 composer update -vvv
。转储看起来像这样(额外的奇怪之处:这是从命令提示符复制的,如果我执行相同的命令但尝试使用 > 命令将其写入 txt 文件,则过程会在 Downloading https:///packagist.org/packages.json
行)
C:\wamp\www\Dropbox\ltest>composer update -vvv
Reading ./composer.json
Executing command (CWD): git describe --exact-match --tags
Executing command (CWD): git branch --no-color --no-abbrev -v
Loading composer repositories with package information
Downloading https://packagist.org/packages.json
Writing C:/Users/aske/AppData/Local/Composer/repo/https---packagist.org/packages
.json into cache
Updating dependencies (including require-dev)
Reading C:/Users/aske/AppData/Local/Composer/repo/https---packagist.org/p-provid
er-active.json from cache
Reading C:/Users/aske/AppData/Local/Composer/repo/https---packagist.org/p-provid
er-archived.json from cache
Reading C:/Users/aske/AppData/Local/Composer/repo/https---packagist.org/p-provid
er-latest.json from cache
Reading C:/Users/aske/AppData/Local/Composer/repo/https---packagist.org/p-provid
er-stale.json from cache
Reading C:/Users/aske/AppData/Local/Composer/repo/https---packagist.org/provider
-laravelbook$ardent.json from cache
Reading C:/Users/aske/AppData/Local/Composer/repo/https---packagist.org/provider
-laravel$laravel.json from cache
Reading C:/Users/aske/AppData/Local/Composer/repo/https---packagist.org/provider
-psr$log.json from cache
Reading C:/Users/aske/AppData/Local/Composer/repo/https---packagist.org/provider
-symfony$http-foundation.json from cache
Reading C:/Users/aske/AppData/Local/Composer/repo/https---packagist.org/provider
-symfony$http-kernel.json from cache
Reading C:/Users/aske/AppData/Local/Composer/repo/https---packagist.org/provider
-stack$builder.json from cache
Reading C:/Users/aske/AppData/Local/Composer/repo/https---packagist.org/provider
-symfony$event-dispatcher.json from cache
Reading C:/Users/aske/AppData/Local/Composer/repo/https---packagist.org/provider
-symfony$debug.json from cache
Reading C:/Users/aske/AppData/Local/Composer/repo/https---packagist.org/provider
-predis$predis.json from cache
Reading C:/Users/aske/AppData/Local/Composer/repo/https---packagist.org/provider
-phpseclib$phpseclib.json from cache
Reading C:/Users/aske/AppData/Local/Composer/repo/https---packagist.org/provider
-nesbot$carbon.json from cache
Reading C:/Users/aske/AppData/Local/Composer/repo/https---packagist.org/provider
-monolog$monolog.json from cache
Reading C:/Users/aske/AppData/Local/Composer/repo/https---packagist.org/provider
-nikic$php-parser.json from cache
Reading C:/Users/aske/AppData/Local/Composer/repo/https---packagist.org/provider
-jeremeamia$superclosure.json from cache
Reading C:/Users/aske/AppData/Local/Composer/repo/https---packagist.org/provider
-jeremeamia$functionparser.json from cache
Reading C:/Users/aske/AppData/Local/Composer/repo/https---packagist.org/provider
-ircmaxell$password-compat.json from cache
Reading C:/Users/aske/AppData/Local/Composer/repo/https---packagist.org/provider
-filp$whoops.json from cache
Reading C:/Users/aske/AppData/Local/Composer/repo/https---packagist.org/provider
-d11wtq$boris.json from cache
Reading C:/Users/aske/AppData/Local/Composer/repo/https---packagist.org/provider
-symfony$console.json from cache
Reading C:/Users/aske/AppData/Local/Composer/repo/https---packagist.org/provider
-symfony$filesystem.json from cache
Reading C:/Users/aske/AppData/Local/Composer/repo/https---packagist.org/provider
-symfony$finder.json from cache
Reading C:/Users/aske/AppData/Local/Composer/repo/https---packagist.org/provider
-classpreloader$classpreloader.json from cache
Reading C:/Users/aske/AppData/Local/Composer/repo/https---packagist.org/provider
-patchwork$utf8.json from cache
Reading C:/Users/aske/AppData/Local/Composer/repo/https---packagist.org/provider
-swiftmailer$swiftmailer.json from cache
Reading C:/Users/aske/AppData/Local/Composer/repo/https---packagist.org/provider
-symfony$browser-kit.json from cache
Reading C:/Users/aske/AppData/Local/Composer/repo/https---packagist.org/provider
-symfony$css-selector.json from cache
Reading C:/Users/aske/AppData/Local/Composer/repo/https---packagist.org/provider
-symfony$dom-crawler.json from cache
Reading C:/Users/aske/AppData/Local/Composer/repo/https---packagist.org/provider
-symfony$process.json from cache
Reading C:/Users/aske/AppData/Local/Composer/repo/https---packagist.org/provider
-symfony$routing.json from cache
Reading C:/Users/aske/AppData/Local/Composer/repo/https---packagist.org/provider
-symfony$security.json from cache
Reading C:/Users/aske/AppData/Local/Composer/repo/https---packagist.org/provider
-symfony$translation.json from cache
Reading C:/Users/aske/AppData/Local/Composer/repo/https---packagist.org/provider
-laravel$framework.json from cache
Reading C:/Users/aske/AppData/Local/Composer/repo/https---packagist.org/provider
-doctrine$dbal.json from cache
Reading C:/Users/aske/AppData/Local/Composer/repo/https---packagist.org/provider
-doctrine$common.json from cache
Reading C:/Users/aske/AppData/Local/Composer/repo/https---packagist.org/provider
-doctrine$inflector.json from cache
Reading C:/Users/aske/AppData/Local/Composer/repo/https---packagist.org/provider
-doctrine$cache.json from cache
Reading C:/Users/aske/AppData/Local/Composer/repo/https---packagist.org/provider
-doctrine$collections.json from cache
Reading C:/Users/aske/AppData/Local/Composer/repo/https---packagist.org/provider
-doctrine$lexer.json from cache
Reading C:/Users/aske/AppData/Local/Composer/repo/https---packagist.org/provider
-doctrine$annotations.json from cache
Reading C:/Users/aske/AppData/Local/Composer/repo/https---packagist.org/provider
-illuminate$support.json from cache
Reading C:/Users/aske/AppData/Local/Composer/repo/https---packagist.org/provider
-illuminate$database.json from cache
Reading C:/Users/aske/AppData/Local/Composer/repo/https---packagist.org/provider
-illuminate$validation.json from cache
Reading C:/Users/aske/AppData/Local/Composer/repo/https---packagist.org/provider
-illuminate$container.json from cache
Reading C:/Users/aske/AppData/Local/Composer/repo/https---packagist.org/provider
-illuminate$events.json from cache
Reading C:/Users/aske/AppData/Local/Composer/repo/https---packagist.org/provider
-illuminate$auth.json from cache
Reading C:/Users/aske/AppData/Local/Composer/repo/https---packagist.org/provider
-illuminate$cache.json from cache
Reading C:/Users/aske/AppData/Local/Composer/repo/https---packagist.org/provider
-illuminate$config.json from cache
Reading C:/Users/aske/AppData/Local/Composer/repo/https---packagist.org/provider
-illuminate$console.json from cache
Reading C:/Users/aske/AppData/Local/Composer/repo/https---packagist.org/provider
-illuminate$cookie.json from cache
Reading C:/Users/aske/AppData/Local/Composer/repo/https---packagist.org/provider
-illuminate$encryption.json from cache
Reading C:/Users/aske/AppData/Local/Composer/repo/https---packagist.org/provider
-illuminate$exception.json from cache
Reading C:/Users/aske/AppData/Local/Composer/repo/https---packagist.org/provider
-illuminate$filesystem.json from cache
Reading C:/Users/aske/AppData/Local/Composer/repo/https---packagist.org/provider
-illuminate$foundation.json from cache
Reading C:/Users/aske/AppData/Local/Composer/repo/https---packagist.org/provider
-illuminate$hashing.json from cache
Reading C:/Users/aske/AppData/Local/Composer/repo/https---packagist.org/provider
-illuminate$html.json from cache
Reading C:/Users/aske/AppData/Local/Composer/repo/https---packagist.org/provider
-illuminate$http.json from cache
Reading C:/Users/aske/AppData/Local/Composer/repo/https---packagist.org/provider
-illuminate$log.json from cache
Reading C:/Users/aske/AppData/Local/Composer/repo/https---packagist.org/provider
-illuminate$mail.json from cache
Reading C:/Users/aske/AppData/Local/Composer/repo/https---packagist.org/provider
-illuminate$pagination.json from cache
Reading C:/Users/aske/AppData/Local/Composer/repo/https---packagist.org/provider
-illuminate$queue.json from cache
Reading C:/Users/aske/AppData/Local/Composer/repo/https---packagist.org/provider
-illuminate$redis.json from cache
Reading C:/Users/aske/AppData/Local/Composer/repo/https---packagist.org/provider
-illuminate$routing.json from cache
Reading C:/Users/aske/AppData/Local/Composer/repo/https---packagist.org/provider
-illuminate$session.json from cache
Reading C:/Users/aske/AppData/Local/Composer/repo/https---packagist.org/provider
-illuminate$translation.json from cache
Reading C:/Users/aske/AppData/Local/Composer/repo/https---packagist.org/provider
-illuminate$view.json from cache
Reading C:/Users/aske/AppData/Local/Composer/repo/https---packagist.org/provider
-illuminate$workbench.json from cache
Reading C:/Users/aske/AppData/Local/Composer/repo/https---packagist.org/provider
-symfony$security-acl.json from cache
Reading C:/Users/aske/AppData/Local/Composer/repo/https---packagist.org/provider
-symfony$security-core.json from cache
Reading C:/Users/aske/AppData/Local/Composer/repo/https---packagist.org/provider
-symfony$security-csrf.json from cache
Reading C:/Users/aske/AppData/Local/Composer/repo/https---packagist.org/provider
-symfony$security-http.json from cache
Nothing to install or update
Reading ./composer.lock
Generating autoload files
Executing command (CWD): php artisan clear-compiled
Executing command (CWD): php artisan optimize
Generating optimized class loader
最终所需的文件没有添加到 vendor/bin/
中。据我所知,此时应该已经放置了一个名为 phpunit.php
的文件,但没有任何迹象。
Here is my composer.lock
作为奖励信息,运行更新后没有任何 phpunit 的迹象。
最佳答案
添加PHPUnit失败的原因是你的composer.json中有两个名为“require”的键,这是非法的。最后一个实例会覆盖第一个实例 - 这会覆盖添加的 PHPUnit 要求。
只有将其更改为“require-dev”(这是一个不同的键)后,Composer 才能检测到您需要 PHPUnit。
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"require": {
"laravel/framework": "4.1.*",
"laravelbook/ardent": "dev-master",
"phpunit/phpunit": "4.2.*" // i have also tried with 3.7 and 3.8
},
// deleted lines here...
"minimum-stability": "stable",
"require": {
"laravelbook/ardent": "dev-master"
}
}
看到“require”作为 JSON 中最后一个缩进严重的键了吗?这至少会让 Composer 感到困惑。我很确定“laravelbook/ardent”依赖于“laravel/framework”和大量其他内容,因此您没有看到您的第一个 require 键被覆盖。
建议:始终使用命令行添加内容 - 这更容易,而且您不必注意正确的 JSON 格式:
composer require --dev phpunit/phpunit:~4.0
这会将依赖项添加到composer.json文件中,如果没有冲突,则立即下载它。它还将编写一个新的、格式清晰的composer.json 文件。如果 Composer 有机会删除双键,您就会很快发现错误。
关于php - Composer 更新未在 Laravel 中安装 PHPUnit?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23594970/
我使用以下命令使用 Composer 删除了一个包。 composer remove sjparkinson/static-review 以上命令从 composer.json 中删除条目文件但 co
我刚刚开始使用 Composer 功能,你告诉它查看本地目录的依赖关系,这样你就可以开发一个库和一些并行使用该库的东西,而不必一直推送到 git 来更新,这是惊人的。例如 "repositories"
composer 和有什么区别和 composer.phar ? 例子: composer install composer.phar install 我一直看到使用 composer.phar 编写
阅读docker-compose -h或this official manual的帮助将为我们提供--project-directory PATH选项 docker-compose [-f ...]
我已经使用他们的安装指南在我的 Linux/Apache 服务器上的根目录(这是默认选择)中成功安装了 Composer。到目前为止,一切都非常简单,除了我必须进行的一个 php.ini 调整( de
在我的 composer.json配置文件,我有: "require": { "zendframework/zend-log" : "~2.3", }, "require-dev": {
从 Composer 安装此软件包后,我想复制位于软件包内的一些文件。 实际上,我希望在从 Composer 安装或更新软件包后,将下载的软件包中可能存在的某个文件复制到另一个目录。我用 script
我对码头公司还是个新手。我使用的是最新版本的Python、Django和Docker。我已经在这个项目上工作了两周了,我已经创建了docker-compose.yml文件,并且已经构建了我的docke
我正在尝试使用 composer 安装一个 github 项目并得到以下错误 Composer [UnexpectedValueException]您的 github.com 的 Github oau
我开发 Symfony 包的工作流程如下: 安装 Symfony 为新包创建一个 git repo,在其中放置一个 composer.json 文件 需要顶级 composer.json 中的新包,使
我正在尝试使用 composer 安装 github 项目并收到以下错误 Composer [UnexpectedValueException] 您用于 github.com 的 Github oau
我们在项目中使用了 composer。当我开发和/或向项目提交任何内容时,我通常应该使用 composer install;更新依赖项只是偶尔进行。 我们还使用 https://github.com/
我在 youtube 上学会了这个抽屉 https://www.youtube.com/watch?v=JLICaBEiJS0&list=PLQkwcJG4YTCSpJ2NLhDTHhi6XBNfk9
我知道在 onClick 中调用可组合函数是不可能的。 @Composable 调用只能在 @Composable 函数的上下文中发生 撰写版本 - alpha06 但我坚持以下要求。 要求是, 在
这是我的 docker-compose.yml 文件: version: '3.1' services: a: image: tutum/hello-world b: imag
创建Asset实例时是否有auto_increment字段类型可用。例如, Assets ID 应该是自动生成的字段,应该在运行时创建,而不是在应用程序级别提及该值。我可以通过创建一个交易处理器函数来
在 Composer 项目中,我必须添加一个库,它没有 composer.json 并且不使用命名空间。因此,我调整了项目的 composer.json 以添加库: { [...] "
当 vendor 目录中已经有一些组件被下载时.. 在上面运行 install 以及运行 update 时有什么影响? 最佳答案 所以我有同样的问题,这是我发现的: composer install
尝试运行 composer install 时出现此错误。我已经运行了 composer update,我正在尝试使用这个最新的锁定文件进行安装。没有任何帮助。 Loading composer re
当我尝试做: $ sudo php composer.phar update 我收到此警告: Warning: This development build of composer is over 3
我是一名优秀的程序员,十分优秀!