php Laravel,composer 安装,不安装laravel/framework

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/41522994/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-26 02:24:28  来源:igfitidea点击:

Laravel, composer install, don't install laravel/framework

phplaravelinstallcomposer-php

提问by

Need Laravel expert to help me figure out what is wrong with my composer.json configuration. I googled for answers and follow along and aldo I check every possible line, I still can get this to work. I got these files from git repo and it works in the office, but when I tried to do the same thing at home, this happend.

需要 Laravel 专家帮助我找出我的 composer.json 配置有什么问题。我在谷歌上搜索答案并继续进行,并且我检查了所有可能的行,我仍然可以让它工作。我从 git repo 获得了这些文件并且它在办公室工作,但是当我试图在家里做同样的事情时,这发生了。

The error I am getting is:

我得到的错误是:

  Problem 1
- Conclusion: don't install laravel/framework v5.1.45
- Conclusion: don't install laravel/framework v5.1.44
- Conclusion: don't install laravel/framework v5.1.43
- Conclusion: don't install laravel/framework v5.1.42
- Conclusion: don't install laravel/framework v5.1.41
- Conclusion: don't install laravel/framework v5.1.40
- Conclusion: don't install laravel/framework v5.1.39
- Conclusion: don't install laravel/framework v5.1.38
- Conclusion: don't install laravel/framework v5.1.37
- Conclusion: don't install laravel/framework v5.1.36
- Conclusion: don't install laravel/framework v5.1.35
- Conclusion: don't install laravel/framework v5.1.34
- Conclusion: don't install laravel/framework v5.1.33
- Conclusion: don't install laravel/framework v5.1.32
- Conclusion: don't install laravel/framework v5.1.31
- Conclusion: don't install laravel/framework v5.1.30
- Conclusion: don't install laravel/framework v5.1.29
- Conclusion: don't install laravel/framework v5.1.28
- Conclusion: don't install laravel/framework v5.1.27
- Conclusion: don't install laravel/framework v5.1.26
- Conclusion: don't install laravel/framework v5.1.25
- Conclusion: don't install laravel/framework v5.1.24
- Conclusion: don't install laravel/framework v5.1.23
- Conclusion: don't install laravel/framework v5.1.22
- Conclusion: don't install laravel/framework v5.1.21
- Conclusion: don't install laravel/framework v5.1.20
- Conclusion: don't install laravel/framework v5.1.19
- Conclusion: don't install laravel/framework v5.1.18
- Conclusion: don't install laravel/framework v5.1.17
- Conclusion: don't install laravel/framework v5.1.16
- Conclusion: don't install laravel/framework v5.1.15
- Conclusion: don't install laravel/framework v5.1.14
- Conclusion: don't install laravel/framework v5.1.13
- Conclusion: don't install laravel/framework v5.1.12
- Conclusion: don't install laravel/framework v5.1.11
- Conclusion: don't install laravel/framework v5.1.10
- Conclusion: don't install laravel/framework v5.1.9
- Conclusion: don't install laravel/framework v5.1.8
- Conclusion: don't install laravel/framework v5.1.7
- Conclusion: don't install laravel/framework v5.1.6
- Conclusion: don't install laravel/framework v5.1.5
- Conclusion: don't install laravel/framework v5.1.4
- Conclusion: don't install laravel/framework v5.1.3
- Installation request for orangehill/iseed dev-master -> satisfiable by orangehill/iseed[dev-master].
- Conclusion: don't install laravel/framework v5.1.2
- Conclusion: don't install laravel/framework v5.1.1
- orangehill/iseed dev-master requires illuminate/support ~5.3.8 -> satisfiable by illuminate/support[v5.3.16, v5.3.23].
- don't install illuminate/support v5.3.16|don't install laravel/framework v5.1.0
- don't install illuminate/support v5.3.23|don't install laravel/framework v5.1.0
- Installation request for laravel/framework 5.1.* -> satisfiable by laravel/framework[v5.1.0, v5.1.1, v5.1.10, v5.1.11, v5.1.12, v5.1.13, v5.1.14, v5.1.15, v5.1.16, v5.1.17, v5.1.18, v5.1.19, v5.1.2, v5.1.20, v5.1.21, v5.1.22, v5.1.23, v5.1.24, v5.1.25, v5.1.26, v5.1.27, v5.1.28, v5.1.29, v5.1.3, v5.1.30, v5.1.31, v5.1.32, v5.1.33, v5.1.34, v5.1.35, v5.1.36, v5.1.37, v5.1.38, v5.1.39, v5.1.4, v5.1.40, v5.1.41, v5.1.42, v5.1.43, v5.1.44, v5.1.45, v5.1.5, v5.1.6, v5.1.7, v5.1.8, v5.1.9].

And here is my composer.json:

这是我的 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.*",
    "barryvdh/laravel-debugbar": "^2.0",
    "intervention/image": "^2.3",
    "laracasts/flash": "~1.3",
    "laravelcollective/html": "5.1.*",
    "cviebrock/eloquent-sluggable": "^3.1",
    "kyslik/column-sortable": "~5.0.0",
    "propaganistas/laravel-phone": "~2.0",
   "mcamara/laravel-localization": "1.0.*",
    "caouecs/laravel-lang": "~3.0",
    "dimsav/laravel-translatable": "^6.0",
    "doctrine/dbal": "^2.5",
    "barryvdh/laravel-translation-manager": "0.2.3",
    "maatwebsite/excel": "~2.1.0"
},
"require-dev": {
    "fzaninotto/faker": "~1.4",
    "mockery/mockery": "0.9.*",
    "phpunit/phpunit": "~4.0",
    "phpspec/phpspec": "~2.1",
    "orangehill/iseed": "dev-master"
},
"autoload": {
    "classmap": [
        "database"
    ],
    "psr-4": {
        "App\": "app/"
    },
    "files" : [
        "app/Helpers/helpers.php"
    ]
},
"autoload-dev": {
    "classmap": [
        "tests/TestCase.php"
    ]
},
"scripts": {
    "post-root-package-install": [
        "php -r \"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"
    ]
},
"config": {
    "preferred-install": "dist"
}
}

回答by John

If you are using lower version of laravel like 5.7.2 and your package needs 5.7.7 then try this:

如果您使用的是 5.7.2 等较低版本的 laravel,并且您的包需要 5.7.7,请尝试以下操作:

composer require laravel/framework

回答by Ashwani Garg

Just remove this dependency from your compose.json if you want to use Laravel 6 or above

如果您想使用 Laravel 6 或更高版本,只需从您的 compose.json 中删除此依赖项

laravelcollective/html

and then run composer update in your terminal

然后在终端中运行 composer update

composer update

回答by Jhonatan Martinez

If you have not previously installed packages, the package.json file and composer add-ons need the composer install command, not composer update command.

如果您之前没有安装过软件包,package.json 文件和 composer 附加组件需要 composer install 命令,而不是 composer update 命令。

composer install

回答by Saumini Navaratnam

Update composer.jsonfile to install latest Laravel version. You need to update the php version for that as well.

更新composer.json文件以安装最新的 Laravel 版本。您还需要为此更新 php 版本。

"laravel/framework": "5.3.*",
"php": ">=5.6.4",

Update

更新

Since you don't want to install the latest Laravel version. From the error log -

由于您不想安装最新的 Laravel 版本。从错误日志 -

orangehill/iseed dev-master requires illuminate/support ~5.3.8

orangehill/iseed dev-master 需要照明/支持 ~5.3.8

This is under require-dev. Therefore you try composer install --no-devwhich won't install the plugins under require-dev. Those plugins mostly use for application testing.

这是下require-dev。因此,您尝试composer install --no-devrequire-dev. 这些插件主要用于应用程序测试。

回答by jed

Here is a tip, go through your composer.jsonfile if there are dependencies not being used by your application, delete them from your composer.jsonfile.

这是一个提示,composer.json如果您的应用程序没有使用依赖项,请检查您的文件,将它们从您的composer.json文件中删除。

Then run composer update

然后运行 composer update