您的要求无法解决:无法打开流:权限被拒绝

时间:2017-02-21 09:46:21

标签: composer-php composer.json

我需要在我的项目中安装DomPDf。所以,我将“barryvdh / laravel-dompdf”:“v0.7.0”,添加到composer require块。当我更新作曲家显示跟随错误。什么是我的错误....请指定给我..

终端错误

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - dompdf/dompdf v0.7.0-beta3 requires phenx/php-font-lib 0.4.* -> no matching package found.
    - dompdf/dompdf v0.7.0-beta2 requires phenx/php-font-lib 0.4.* -> no matching package found.
    - dompdf/dompdf v0.7.0-beta requires phenx/php-font-lib 0.3.* -> no matching package found.
    - dompdf/dompdf v0.7.0 requires phenx/php-font-lib 0.4.* -> no matching package found.
    - dompdf/dompdf 0.7.x-dev requires phenx/php-font-lib 0.5.* -> no matching package found.
    - barryvdh/laravel-dompdf v0.7.0 requires dompdf/dompdf ^0.7 -> satisfiable by dompdf/dompdf[0.7.x-dev, v0.7.0, v0.7.0-beta, v0.7.0-beta2, v0.7.0-beta3].
    - Installation request for barryvdh/laravel-dompdf v0.7.0 -> satisfiable by barryvdh/laravel-dompdf[v0.7.0].

Potential causes:
 - A typo in the package name
 - The package is not available in a stable-enough version according to your minimum-stability setting
   see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.

我的作曲家代码

{
    "name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "minimum-stability" : "dev",
    "prefer-stable": true,
    "license": "MIT",
    "type": "project",
    "require": {
        "php": ">=5.6.4",
        "barryvdh/laravel-debugbar": "^2.3",
"barryvdh/laravel-dompdf": "v0.7.0",
        "laravel/framework": "5.4.*",
        "laravel/tinker": "~1.0",
        "uxweb/sweet-alert": "^1.4" 
    },
    "require-dev": {
        "fzaninotto/faker": "~1.4",
        "mockery/mockery": "0.9.*",
        "phpunit/phpunit": "~5.0"
    },
    "autoload": {
        "classmap": [
            "database"
        ],
        "psr-4": {
            "App\\": "app/"
        }
    }

我也试过了:

composer require barryvdh/laravel-dompdf

但显示以下错误:

  

错误:使用版本^ 0.8.0 for barryvdh / laravel-dompdf ./composer.json已更新使用包信息加载composer存储库

     

更新依赖项(包括require-dev)

     

file_put_contents(/home/w3cert/.composer/cache/repo/https --- packagist.org/p-prov ider-2017-01.json):无法打开流:权限被拒绝

     

packagist.org无法完全加载,包信息是从本地缓存加载的,可能已过期

     

您的要求无法解析为可安装的软件包。

3 个答案:

答案 0 :(得分:1)

为什么不尝试从命令行安装它

composer require barryvdh/laravel-dompdf

请在安装前从composer.json删除此行。

"barryvdh/laravel-dompdf": "v0.7.0"

无论如何laravel-dompdf的当前版本:( v0.8.0)

答案 1 :(得分:1)

由于您在运行composer require barryvdh/laravel-dompdf时遇到 Permission denied 错误,因此这是应该修复它们的命令:

chown -R $USER ~/.composer

或:

sudo chown -R $USER ~/.composer

然后清除Composer缓存:

composer clear

然后尝试避免使用composer运行sudo命令以不中断文件权限。

如果仍有问题,请进行故障排除,运行以下shell命令:

composer diagnose

答案 2 :(得分:0)

安装应该适用于当前版本的dompdf

"barryvdh/laravel-dompdf": "^0.8.0"