git 为什么工匠不处理作曲家更新并且不返回错误消息?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/20640623/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Why doesn't artisan work on composer update and return no error messages?
提问by JaidynReiman
I've been running into a hundred problems with laravel. I recently upgraded a laravel 3 website to laravel 4, and I saved my entire project into a repository on Github. As I'm constantly having trouble accidentally editing files from the wrong folder, I just created the local git repository in my working directory so I've got exactly one directory to deal with.
我在 Laravel 上遇到了一百个问题。我最近将一个 laravel 3 网站升级到了 laravel 4,并将我的整个项目保存到 Github 上的一个存储库中。由于我经常遇到不小心编辑错误文件夹中的文件的问题,我只是在我的工作目录中创建了本地 git 存储库,因此我只有一个目录要处理。
Everything was working fine until I tried to install some laravel packages, which I have been able to install before. Whenever I run composer update, ALL of my artisan scripts return an error. The error message itself (presumably a PHP error) does not display, even after I made sure I was using the development PHP.ini file.
一切正常,直到我尝试安装一些 Laravel 包,我之前已经能够安装这些包。每当我运行 composer update 时,我的所有工匠脚本都会返回一个错误。错误消息本身(可能是 PHP 错误)不会显示,即使在我确定我正在使用开发 PHP.ini 文件之后也是如此。
fatal: No names found, cannot describe anything.
* master [KEY REMOVED] Remove mPDF Library
Script php artisan clear-compiled handling the pre-update-cmd event returned with an error
Status for device CON:
----------------------
Lines: 300
Columns: 80
Keyboard rate: 31
Keyboard delay: 1
Code page: 437
Status for device CON:
----------------------
Lines: 300
Columns: 80
Keyboard rate: 31
Keyboard delay: 1
Code page: 437
[RuntimeException]
Error Output:
update [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--lock] [--no-plugins] [--no-custom-installers] [--no-scripts] [--no-progress] [--with-dependencies] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [packages1] ... [packagesN]
Here's my composer.json (one suggestion I read was to put "php artisan clear-compiled" in "pre-update-cmd"):
这是我的 composer.json(我读到的一个建议是将“php artisan clear-compiled”放在“pre-update-cmd”中):
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"require": {
"laravel/framework": "4.1.*"
},
"autoload": {
"classmap": [
"app/commands",
"app/controllers",
"app/models",
"app/database/migrations",
"app/database/seeds",
"app/tests/TestCase.php"
]
},
"scripts": {
"post-install-cmd": [
"php artisan optimize"
],
"pre-update-cmd": [
"php artisan clear-compiled"
],
"post-update-cmd": [
"php artisan optimize"
],
"post-create-project-cmd": [
"php artisan key:generate"
]
},
"config": {
"preferred-install": "dist"
},
"minimum-stability": "dev",
"require": {
"laravelbook/ardent" : "dev-master",
"loic-sharma/profiler" : "dev-master",
"prologue/alerts" : "dev-master",
"mpdf/mpdf" : "dev-master"
}
}
Another weird thing I noticed was this:
我注意到的另一个奇怪的事情是:
fatal: No names found, cannot describe anything.
* master [KEY REMOVED] Remove mPDF Library
This is referencing the latest commit in my git repo. Why is it mentioning this? I thought that this might be part of the problem until I realized it was messing up even on a brand new install.
这是引用我的 git repo 中的最新提交。为什么提到这个?我认为这可能是问题的一部分,直到我意识到即使在全新安装时也会出现问题。
Yes, I have tried removing the scripts or running --no-scripts. I think this is where my problems start, though, because even when I do run --no-scripts I get the following error:
是的,我尝试删除脚本或运行 --no-scripts。不过,我认为这是我的问题开始的地方,因为即使我运行 --no-scripts 我也会收到以下错误:
Fatal error: Class 'Patchwork\Utf8\Bootup' not found in [ROOT PATH REMOVED]/bootstrap/autoload.php on line 46
I read that some files may have been missing as I had upgraded to 4.1. So I filled in all the missing files and I got a blank white page.
我读到一些文件可能在我升级到 4.1 后丢失了。所以我填写了所有丢失的文件,我得到了一个空白的白页。
Based on what I'm reading, a brand new install of laravel should be able to run artisan, or at least after running composer install
. I can't even get this to work on a BRAND NEW INSTALL. So I updated my xampp installation to the latest version.
根据我正在阅读的内容,全新安装的 laravel 应该能够运行 artisan,或者至少在运行composer install
. 我什至无法让它在全新安装上工作。所以我更新了我的 xampp 安装到最新版本。
I also read that there was a way to check if mcrypt was installed: php -i | grep "mcrypt support"
It stated that if nothing was returned mcrypt wasn't installed, but it definitely returned something.
我还读到有一种方法可以检查是否安装了 mcrypt:php -i | grep "mcrypt support"
它表示如果没有返回任何东西,则 mcrypt 没有安装,但它肯定返回了一些东西。
mcrypt
mcrypt support => enabled
mcrypt support => enabledmcrypt_filter support =>
enabled
Version => 2.5.8
Api No => 20021217
Supported ciphers => cast-128 gost rijndael-128 twofish cast-256 loki97 rijndael-192 saferplus wake blowfish-compat des rijndael-256 serpent xtea blowfish enigma rc2 tripledes arcfour
Supported modes => cbc cfb ctr ecb ncfb nofb ofb stream
Directive => Local Value => Master Value
mcrypt.algorithms_dir => no value => no value
mcrypt.modes_dir => no value => no value
composer update returns no error, artisan doesn't work, it doesn't work when I use --no-scripts and still doesn't compile after I used --no-scripts... PHP doesn't return any errors or log any errors either. I don't know what else to do. I've tried everything I could think of, and everything I could find online. All I wanted was to install a simple package, not run into this huge mess.
composer update 没有返回错误,artisan 不起作用,当我使用 --no-scripts 时它不起作用,并且在我使用 --no-scripts 后仍然无法编译...... PHP 不返回任何错误或记录任何错误。我不知道还能做什么。我已经尝试了我能想到的所有方法,以及我可以在网上找到的所有方法。我想要的只是安装一个简单的包,而不是遇到这么大的混乱。
I'm hesitant to continue working on this project until I get this issue resolved, but I have to get back to work on it using my still working version of laravel (thankfully I had backup copies of the /vendor files; they weren't being added to my github repo).
在我解决这个问题之前,我很犹豫要不要继续这个项目,但我必须使用我仍在工作的 laravel 版本重新开始工作(幸好我有 /vendor 文件的备份副本;他们没有被添加到我的 github 存储库中)。
But any help on this would be greatly appreciated because I really do need to use those packages and I know I'll have problems in the future if I try updating again.
但对此的任何帮助将不胜感激,因为我确实需要使用这些软件包,而且我知道如果我再次尝试更新,我将来会遇到问题。
EDIT: And of note, one common answer I've seen to a variety of questions is to delete bootstrap/compiled.php. Well, no matter what I've never even seen the file generated, let alone being able to delete it.
编辑:请注意,我在各种问题中看到的一个常见答案是删除 bootstrap/compiled.php。好吧,不管我什至从未见过生成的文件,更不用说能够删除它了。
I even tried running the artisan commands manually (which returned a blank result) and the file never generated.
我什至尝试手动运行工匠命令(返回空白结果)并且文件从未生成。
回答by JaidynReiman
Getting an answer to this is nigh-impossible. After extensive testing I still found myself no closer to the answer. I don't even know if this is the correct answer, but I FINALLY got artisan to run properly. Here's what I did.
得到这个问题的答案几乎是不可能的。经过广泛的测试,我仍然发现自己离答案更近了。我什至不知道这是否是正确答案,但我终于让工匠正常运行。这就是我所做的。
To start, I installed a FRESH copy of Laravel (4.1) using composer:
首先,我使用 Composer 安装了 Laravel (4.1) 的新副本:
composer create-project laravel/laravel --prefer-dist
Using this composer file (basically the same as the above without the packages require):
使用这个 Composer 文件(与上面的基本相同,没有包需要):
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"require": {
"laravel/framework": "4.1.*"
},
"autoload": {
"classmap": [
"app/commands",
"app/controllers",
"app/models",
"app/database/migrations",
"app/database/seeds",
"app/tests/TestCase.php"
]
},
"scripts": {
"post-install-cmd": [
"php artisan optimize"
],
"pre-update-cmd": [
"php artisan clear-compiled"
],
"post-update-cmd": [
"php artisan optimize"
],
"post-create-project-cmd": [
"php artisan key:generate"
]
},
"config": {
"preferred-install": "dist"
},
"minimum-stability": "dev"
}
And running:
并运行:
composer update --no-scripts
Followed by:
其次是:
composer update
It no longer threw errors at me when I uploaded it.
当我上传它时,它不再向我抛出错误。
Unfortunately, I can't get ANY packages to work at all. I think its a bug in the latest version of Laravel, and its VERY annoying. I highly doubt that literally every package broke in 4.1, though its POSSIBLE that this is the problem: http://forums.laravel.io/viewtopic.php?pid=55313#p55313
不幸的是,我根本无法使用任何软件包。我认为这是 Laravel 最新版本中的一个错误,而且非常烦人。我非常怀疑每个包都在 4.1 中损坏,尽管这可能是问题所在:http: //forums.laravel.io/viewtopic.php?pid=55313#p55313
Another possibility, too, is to run composer install first:
另一种可能性也是先运行 composer install :
composer install --no-scripts
The "--no-scripts" is optional, if it doesn't install normally --no-scripts isn't needed. At one point I deleted my vendor folder and ran composer install but I couldn't figure it out regardless.
“--no-scripts”是可选的,如果它不正常安装--no-scripts 是不需要的。有一次我删除了我的供应商文件夹并运行了 composer install 但无论如何我都无法弄清楚。
Whatever the case may be, I can't use libraries I added into the app/libraries folder (which I've noticed does not exist by default) nor can I use any composer packages at this point. I'm really not sure how I can get my PDF scripts to work right now... or at least until Laravel fixes these issues.
不管是什么情况,我都不能使用我添加到 app/libraries 文件夹中的库(我注意到默认情况下它不存在),此时我也不能使用任何 Composer 包。我真的不确定如何让我的 PDF 脚本立即工作……或者至少在 Laravel 解决这些问题之前。