icanhazstring/Composer Unused(全球安装)包含一个作曲家插头

发布于 2025-02-13 11:14:11 字数 1442 浏览 0 评论 0原文

当我尝试从phpstorm运行“作曲家> install”时,我会收到以下错误:

在pluginmanager.php行762中:

icanhazstring/Composer Unused(全球安装)包含作曲家 插件被您的允许 - 包式配置阻止。您可以添加 如果您认为安全的话,请列表。

您可以运行作曲家全局config -no-plugins允许 - plugins.icanhazstring/composer-unused [true | false]启用它 (true)或明确禁用其并抑制此异常(false)
参见 https://getcomposer.org/allow-plugins

上面此错误消息的原因是什么?

我尝试运行

/etc/php8/bin/php composer.phar global config --no-plugins allow-plugins.icanhazstrin  true

,我还尝试将以下内容添加到composer.json文件中,

    "config": {
        "allow-plugins": true,

但我仍然收到相同的错误消息。

我的composer.json是:

{
    "name": "test/version1",
    "description":"Test Version 1",
    "keywords":[],
    "config": {
        "allow-plugins": true,
        "secure-http":false
    },
    "scripts": {
        "test": "phpunit --config tests/phpunit.xml"
    },
    "require": {
        "php": ">=7.3",
        "monolog/monolog": "1.26.*",

...

    "require-dev": {
        "php": ">=8.1",
        "phpunit/phpunit": "^9.5.0",
        "friendsofphp/php-cs-fixer": "^2.16",
        "icanhazstring/composer-unused": "^0.7.5"
    }
}

When I try to run "Composer > Install" from PhpStorm I get the following error:

In PluginManager.php line 762:

icanhazstring/composer-unused (installed globally) contains a Composer
plug in which is blocked by your allow-plugins config. You may add it
to the list if you consider it safe.

You can run composer global config --no-plugins allow-plugins.icanhazstring/composer-unused [true|false] to enable it
(true) or disable it explicitly and suppress this exception (false)
See https://getcomposer.org/allow-plugins

What might be the reason for this error message above?

I have tried to run

/etc/php8/bin/php composer.phar global config --no-plugins allow-plugins.icanhazstrin  true

and I have also tried to add the following to the composer.json file

    "config": {
        "allow-plugins": true,

but still I get the same error message.

My composer.json is something like:

{
    "name": "test/version1",
    "description":"Test Version 1",
    "keywords":[],
    "config": {
        "allow-plugins": true,
        "secure-http":false
    },
    "scripts": {
        "test": "phpunit --config tests/phpunit.xml"
    },
    "require": {
        "php": ">=7.3",
        "monolog/monolog": "1.26.*",

...

    "require-dev": {
        "php": ">=8.1",
        "phpunit/phpunit": "^9.5.0",
        "friendsofphp/php-cs-fixer": "^2.16",
        "icanhazstring/composer-unused": "^0.7.5"
    }
}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

驱逐舰岛风号 2025-02-20 11:14:11

运行以下命令

/etc/php8/bin/php composer.phar global show -i

,然后将询问您是否要信任icanhazstring/composer-unused。键入y,然后按Enter按钮。就是这样。

然后,如果您转到/home/yourubuntuusername/.config/composer/,您将看到另一个带有以下内容的composer.json.json文件:

{
    "require": {
        "icanhazstring/composer-unused": "^0.7.5"
    },
    "config": {
        "allow-plugins": {
            "icanhazstrin": true,
            "icanhazstring/composer-unused": true
        }
    }
}

显然有一种叫做Global Composer的东西软件包

Run the following command

/etc/php8/bin/php composer.phar global show -i

Then it will ask if you want to trust icanhazstring/composer-unused. Type y and press the enter button. That's it.

Then if you go to /home/yourUbuntuUsername/.config/composer/ there you will see another composer.json file with the following content:

{
    "require": {
        "icanhazstring/composer-unused": "^0.7.5"
    },
    "config": {
        "allow-plugins": {
            "icanhazstrin": true,
            "icanhazstring/composer-unused": true
        }
    }
}

Apparently there is something called global Composer packages ????

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文