laravel composer install 无法解决 tymon/jwt-auth 的可安装包 [英] laravel composer install could not solve installable package for tymon/jwt-auth

查看:29
本文介绍了laravel composer install 无法解决 tymon/jwt-auth 的可安装包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为 laravel 项目运行 composer install.错误如下:

I am trying to run composer install for a laravel project. The error is as below:

Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. Run update to update them.
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for namshi/jose 5.0.2 -> satisfiable by namshi/jose[5.0.2].
    - namshi/jose 5.0.2 requires lib-openssl * -> the requested linked library openssl has the wrong version installed or is missing from your system, make sure to have the extension providing it.
  Problem 2
    - namshi/jose 5.0.2 requires lib-openssl * -> the requested linked library openssl has the wrong version installed or is missing from your system, make sure to have the extension providing it.
    - tymon/jwt-auth 0.5.9 requires namshi/jose 5.0.* -> satisfiable by namshi/jose[5.0.2].
    - Installation request for tymon/jwt-auth 0.5.9 -> satisfiable by tymon/jwt-auth[0.5.9].

我调查了一下,我的 Mac 中的 PHP 似乎没有 openSSL.但是当我运行时

I looked into that, it seems that PHP in my Mac doesn't have openSSL. But when I run

php -m

列表中有 openssl 模块.

There is openssl module in the list.

因此,我不明白问题出在哪里.

Hence, I don't understand what the problem is.

这是我的 composer.json

Here is my 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.*",
    "tymon/jwt-auth": "0.5.*",
    "barryvdh/laravel-ide-helper": "^2.1",
    "fzaninotto/faker": "~1.4",
    "zizaco/entrust": "~2.0"
},
"require-dev": {

    "mockery/mockery": "0.9.*",
    "phpunit/phpunit": "~4.0",
    "phpspec/phpspec": "~2.1"
},
"autoload": {
    "classmap": [
        "database",
        "app/Services"

    ],
    "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"
}

}

PS:刚入了一个全新的Mac pro,还没来得及安装MAMP和Xcode,所以我猜我用的php是内建的

PS: I just got a brand new Mac pro, haven't got time to install MAMP and Xcode, so I guess the php I used is internally built

推荐答案

经过几个小时的搜索和尝试,我设法解决了这个问题.问题是因为我的macbook是新的,根本没有配置,所有的设置都是默认的,包括php内置的php.

After searching and trying for hours, I made my way to solve this problem. The issue is because my macbook is the new one, no configuration at all, all the settings are default, including the php which is built in PHP.

安装好MAMP后,将编译好的php链接到MAMP php,问题就解决了.

After install MAMP, link the built php to MAMP php, then the problem is solved.

我猜 PHP 内置的只​​有一些基本模块,所以它与 MAMP 的 PHP 不兼容.

I guess built in PHP only has some basic modules, so, it is not compatible as the PHP from MAMP.

请参阅这篇关于 如何链接到 MAMP PHP.

这篇关于laravel composer install 无法解决 tymon/jwt-auth 的可安装包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆