我正在使用Laravel 5.1并尝试通过composer安装新软件包。我正在使用以下命令。
composer require "matriphe/imageupload:5.1.*"
我收到了以下错误。
./composer.json has been updated
> php artisan clear-compiled
Package "matriphe/imageupload" listed for update is not installed. Ignoring.
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Writing lock file
Generating autoload files
> php artisan optimize
Generating optimized class loader
我也尝试过
composer self-update
这是我收到的信息。
You are already using composer version f1aa655e6113e0efa979b8b09d7951a762eaa04c.
我还尝试通过手动将包名添加到composer.json并运行来更新项目的作曲家依赖项。
composer update
和 通过部分更新。
composer update "matriphe/imageupload:5.1.*"
到目前为止,我已经安装了其他软件包,除了这个软件包之外都安装了所有软件包。
答案 0 :(得分:2)
更新:我以最可怕的方式解决了这个问题。
当我运行命令
时,我最初有以下composer.json文件 composer require "matriphe/imageupload:5.1.*"
和
composer require laravelcollective/html:~5.0
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": ">=5.5.9",
"laravel/framework": "5.1.*",
"matriphe/imageupload": "5.1.*",
"laravelcollective/html": "~5.0"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~4.0",
"phpspec/phpspec": "~2.1"
},
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"App\\": "app/"
}
},
"autoload-dev": {
"classmap": [
"tests/TestCase.php"
]
},
"scripts": {
"post-install-cmd": [
"php artisan clear-compiled",
"php artisan optimize"
],
"pre-update-cmd": [
"php artisan clear-compiled"
],
"post-update-cmd": [
"php artisan optimize"
],
"post-root-package-install": [
"php -r \"copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"php artisan key:generate"
]
},
"config": {
"preferred-install": "dist"
}
}
得到了错误。
Package "matriphe/imageupload" listed for update is not installed. Ignoring.
和
Package "laravelcollective/html" listed for update is not installed. Ignoring
为了解决这个问题,我在json添加了要安装的软件包中手动添加了另一个require数组,如下所示。
"require": {
"laravelcollective/html": "~5.0",
"matriphe/imageupload": "5.1.*"
}
我修改过的composer.json文件看起来像这样。
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": ">=5.5.9",
"laravel/framework": "5.1.*"
},
"require": {
"laravelcollective/html": "~5.0",
"matriphe/imageupload": "5.1.*"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~4.0",
"phpspec/phpspec": "~2.1"
},
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"App\\": "app/"
}
},
"autoload-dev": {
"classmap": [
"tests/TestCase.php"
]
},
"scripts": {
"post-install-cmd": [
"php artisan clear-compiled",
"php artisan optimize"
],
"pre-update-cmd": [
"php artisan clear-compiled"
],
"post-update-cmd": [
"php artisan optimize"
],
"post-root-package-install": [
"php -r \"copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"php artisan key:generate"
]
},
"config": {
"preferred-install": "dist"
}
}
并运行以下命令。
composer update
它为我做了诀窍。
答案 1 :(得分:0)
对我来说,这只是包名的拼写错误。