我根据官方文件将laravel 5.4升级为laravel 5.5,然后执行composer更新,返回此错误
- Installing theseer/tokenizer (1.2.0): Extracting archive
- Installing sebastian/code-unit-reverse-lookup (1.0.2): Extracting archive
- Installing phpunit/php-code-coverage (5.3.2): Extracting archive
- Installing phpspec/prophecy (v1.10.3): Extracting archive
- Installing phar-io/version (1.0.1): Extracting archive
- Installing phar-io/manifest (1.0.1): Extracting archive
- Installing myclabs/deep-copy (1.10.2): Extracting archive
- Installing phpunit/phpunit (6.5.14): Extracting archive
- Installing predis/predis (v1.1.7): Extracting archive
Package jakub-onderka/php-console-color is abandoned, you should avoid using it. Use php-parallel-lint/php-console-color instead.
Package jakub-onderka/php-console-highlighter is abandoned, you should avoid using it. Use php-parallel-lint/php-console-highlighter instead.
Package mtdowling/cron-expression is abandoned, you should avoid using it. Use dragonmantank/cron-expression instead.
Package fzaninotto/faker is abandoned, you should avoid using it. No replacement was suggested.
Package phpunit/php-token-stream is abandoned, you should avoid using it. No replacement was suggested.
Package phpunit/phpunit-mock-objects is abandoned, you should avoid using it. No replacement was suggested.
Generating optimized autoload files
[SeldJsonLintParsingException]
"/home/vagrant/work/exports-api/vendor/composer/installed.json" does not co
ntain valid JSON
Parse error on line 1:
^
Expected one of: 'STRING', 'NUMBER', 'NULL', 'TRUE', 'FALSE', '{', '['
这是我的composer.json
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": ">=5.6.4",
"laravel/framework": "5.5.*",
"laravel/tinker": "~1.0",
"predis/predis": "^1.1"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~6.0",
"filp/whoops": "~2.0"
},
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"App\": "app/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\": "tests/"
}
},
"scripts": {
"post-root-package-install": [
"php -r "file_exists('.env') || copy('.env.example', '.env');""
],
"post-create-project-cmd": [
"php artisan key:generate"
],
"post-install-cmd": [
"Illuminate\Foundation\ComposerScripts::postInstall",
"php artisan optimize"
],
"post-update-cmd": [
"Illuminate\Foundation\ComposerScripts::postUpdate",
"php artisan optimize"
],
"post-autoload-dump": [
"Illuminate\Foundation\ComposerScripts::postAutoloadDump",
"@php artisan package:discover"
]
},
"config": {
"preferred-install": "dist",
"sort-packages": true,
"optimize-autoloader": true
}
}
然后我将检查文件"/home/warrant/work/exports-api/vender/composer/installed.json";这是一个空白,没有
补充说明在更新之前,installed.json中有一些内容,composer更新变为空白。现在,这个项目下的composer操作将返回这个错误
我将composer版本从2.0更改为1.0以解决问题