更新时出现编辑器错误 [意外值异常]



尝试更新作曲家时出现此错误。

我使用命令:

composer update -v --no-dev

我在下面收到此错误(堆栈跟踪(:

Adding VCS repository npm-asset/lodash.uniq 
Adding VCS repository npm-asset/lodash.without
Adding VCS repository npm-asset/mississippi   
Adding VCS repository npm-asset/mkdirp     

[UnexpectedValueException]                                          
Could not parse version constraint &&: Invalid version string "&&"  

Exception trace:
 () at phar:///usr/local/bin/composer/vendor/composer/semver/src/VersionParser.php:485
 ComposerSemverVersionParser->parseConstraint() at phar:///usr/local/bin/composer/vendor/composer/semver/src/VersionParser.php:244
 ComposerSemverVersionParser->parseConstraints() at phar:///usr/local/bin/composer/src/Composer/Package/Version/VersionParser.php:28
 ComposerPackageVersionVersionParser->parseConstraints() at phar:///usr/local/bin/composer/src/Composer/Package/Loader/ArrayLoader.php:238
 ComposerPackageLoaderArrayLoader->parseLinks() at phar:///usr/local/bin/composer/src/Composer/Package/Loader/ArrayLoader.php:122
 ComposerPackageLoaderArrayLoader->load() at /root/.composer/vendor/fxp/composer-asset-plugin/Repository/NpmRepository.php:133
 FxpComposerAssetPluginRepositoryNpmRepository->createArrayRepositoryConfig() at /root/.composer/vendor/fxp/composer-asset-plugin/Repository/NpmRepository.php:79
 FxpComposerAssetPluginRepositoryNpmRepository->createVcsRepositoryConfig() at /root/.composer/vendor/fxp/composer-asset-plugin/Repository/AbstractAssetsRepository.php:136
 FxpComposerAssetPluginRepositoryAbstractAssetsRepository->whatProvides() at phar:///usr/local/bin/composer/src/Composer/DependencyResolver/Pool.php:204
 ComposerDependencyResolverPool->computeWhatProvides() at phar:///usr/local/bin/composer/src/Composer/DependencyResolver/Pool.php:193
 ComposerDependencyResolverPool->whatProvides() at phar:///usr/local/bin/composer/src/Composer/DependencyResolver/RuleSetGenerator.php:161
 ComposerDependencyResolverRuleSetGenerator->whitelistFromPackage() at phar:///usr/local/bin/composer/src/Composer/DependencyResolver/RuleSetGenerator.php:273
 ComposerDependencyResolverRuleSetGenerator->whitelistFromJobs() at phar:///usr/local/bin/composer/src/Composer/DependencyResolver/RuleSetGenerator.php:324
 ComposerDependencyResolverRuleSetGenerator->getRulesFor() at phar:///usr/local/bin/composer/src/Composer/DependencyResolver/Solver.php:214
 ComposerDependencyResolverSolver->solve() at phar:///usr/local/bin/composer/src/Composer/Installer.php:473
 ComposerInstaller->doInstall() at phar:///usr/local/bin/composer/src/Composer/Installer.php:227
 ComposerInstaller->run() at phar:///usr/local/bin/composer/src/Composer/Command/UpdateCommand.php:161
 ComposerCommandUpdateCommand->execute() at phar:///usr/local/bin/composer/vendor/symfony/console/Command/Command.php:242
 SymfonyComponentConsoleCommandCommand->run() at phar:///usr/local/bin/composer/vendor/symfony/console/Application.php:842
 SymfonyComponentConsoleApplication->doRunCommand() at phar:///usr/local/bin/composer/vendor/symfony/console/Application.php:193
 SymfonyComponentConsoleApplication->doRun() at phar:///usr/local/bin/composer/src/Composer/Console/Application.php:251
 ComposerConsoleApplication->doRun() at phar:///usr/local/bin/composer/vendor/symfony/console/Application.php:117
 SymfonyComponentConsoleApplication->run() at phar:///usr/local/bin/composer/src/Composer/Console/Application.php:100
 ComposerConsoleApplication->run() at phar:///usr/local/bin/composer/bin/composer:58
 require() at /usr/local/bin/composer:24

任何人都可以帮我找出如何处理这个?

更新

composer.json 文件:


{
    "name" : "yiisoft/yii2-app-basic",
    "description" : "Yii 2 Basic Project Template",
    "keywords" : [
        "yii2",
        "framework",
        "basic",
        "project template"
    ],
    "homepage" : "http://www.yiiframework.com/",
    "type" : "project",
    "license" : "BSD-3-Clause",
    "support" : {
        "issues" : "https://github.com/yiisoft/yii2/issues?state=open",
        "forum" : "http://www.yiiframework.com/forum/",
        "wiki" : "http://www.yiiframework.com/wiki/",
        "irc" : "irc://irc.freenode.net/yii",
        "source" : "https://github.com/yiisoft/yii2"
    },
    "minimum-stability" : "dev",
    "require" : {
        "php" : ">=5.4.0",
        "yiisoft/yii2" : ">=2.0.11",
        "yiisoft/yii2-bootstrap" : "@dev",
        "yiisoft/yii2-swiftmailer" : "@dev",
        "kartik-v/yii2-widget-select2" : "@dev",
        "kartik-v/yii2-grid" : "@dev",
        "kartik-v/yii2-krajee-base" : "@dev",
        "kartik-v/yii2-mpdf" : "v1.0.0",
        "kartik-v/yii2-editable" : "@dev",
        "kartik-v/yii2-tabs-x" : "@dev",
        "kartik-v/yii2-widget-fileinput" : "@dev",
        "kartik-v/yii2-money" : "*",
        "kartik-v/yii2-widget-datepicker" : "@dev",
        "kartik-v/yii2-widget-activeform" : "@dev",
        "kartik-v/yii2-widget-depdrop" : "@dev",
        "kartik-v/yii2-widgets" : "*",
        "kartik-v/yii2-widget-typeahead" : "*",
        "yiibr/yii2-br-validator" : "*",
        "kartik-v/yii2-builder" : "@dev",
        "softark/yii2-dual-listbox" : "dev-master",
        "kartik-v/yii2-widget-sidenav" : "*",
        "kartik-v/yii2-popover-x" : "@dev",
        "kartik-v/yii2-export" : "*",
        "kartik-v/yii2-detail-view" : "*",
        "bower-asset/Chart.js" : "*",
        "codeception/specify" : "*",
        "codeception/verify" : "*",
        "kartik-v/yii2-date-range" : "^1.6",
        "kartik-v/yii2-checkbox-x" : "*",
        "zendframework/zend-servicemanager" : "^2.7.5 || ^3.0.3",
        "bower-asset/toastr" : "^2.1",
        "cossou/jasperphp" : "2.3.0",
        "endroid/qr-code" : "~2.4.0",
        "nfephp-org/posprint" : "^0.1",
        "nfephp-org/sped-nfe" : "^4.1@dev",
        "nfephp-org/sped-da" : "*"
    },
    "require-dev" : {
        "codeception/codeception" : "2.1.*",
        "yiisoft/yii2-debug" : "*",
        "yiisoft/yii2-gii" : "*",
        "yiisoft/yii2-faker" : "*"
    },
    "config" : {
        "process-timeout" : 1800
    },
    "scripts" : {
        "post-create-project-cmd" : "yii\composer\Installer::postCreateProject"
    },
    "extra" : {
        "yii\composer\Installer::postCreateProject" : {
            "setPermission" : [{
                    "runtime" : "0777",
                    "web/assets" : "0777",
                    "yii" : "0755"
                }
            ],
            "generateCookieValidationKey" : [
                "config/web.php"
            ]
        },
        "asset-installer-paths" : {
            "npm-asset-library" : "vendor/npm",
            "bower-asset-library" : "vendor/bower"
        }
    }
}

作曲家已更新到最新版本,并且似乎没有"&&"约束错误。当我在本地计算机上运行作曲家更新时,它工作正常,但是当我在服务器上执行相同操作时,它会返回此错误。

正如评论中所说,为我解决的是检查本地和服务器上的 fxp/composer-asset-plugin 版本。更新两者解决了我的问题。

检查版本:

composer global show fxp/composer-asset-plugin

更新版本:

composer global require "fxp/composer-asset-plugin:~1.3"

检查PHP版本也总是好的。

相关内容

  • 没有找到相关文章

最新更新