第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機(jī)立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

安裝 api-platform.com 后清除緩存命令出現(xiàn)錯誤

安裝 api-platform.com 后清除緩存命令出現(xiàn)錯誤

PHP
搖曳的薔薇 2023-11-03 15:13:57
我正在嘗試安裝 api-platform,但啟動 Composer 安裝后遇到問題:我按照官方文檔進(jìn)行安裝:composer req api當(dāng)我啟動服務(wù)器或嘗試運(yùn)行時composer install出現(xiàn)此錯誤:Executing script cache:clear [KO] [KO]Script cache:clear returned with error code 255然后是一個警告:[WARNING] Some commands could not be registered:                               !!                                                                                  !!  !!  In DoctrineOrmPropertyMetadataFactory.php line 31:!!                                                                                 !!    Argument 1 passed to ApiPlatform\Core\Bridge\Doctrine\Orm\Metadata\Property  !!    \DoctrineOrmPropertyMetadataFactory::__construct() must be an instance of D  !!    octrine\Common\Persistence\ManagerRegistry, instance of Doctrine\Bundle\Doc  !!    trineBundle\Registry given, called in /var/www/test-api-sf/var/cache/dev/Co  !!    ntainerPA69O1T/App_KernelDevDebugContainer.php on line 1040                  !!                                                                                 !!  !!  In DoctrineOrmPropertyMetadataFactory.php line 31:!!                                                                                 !!    Argument 1 passed to ApiPlatform\Core\Bridge\Doctrine\Orm\Metadata\Property  !!    \DoctrineOrmPropertyMetadataFactory::__construct() must be an instance of D  !!    octrine\Common\Persistence\ManagerRegistry, instance of Doctrine\Bundle\Doc  !!    trineBundle\Registry given, called in /var/www/test-api-sf/var/cache/dev/Co  !!    ntainerPA69O1T/App_KernelDevDebugContainer.php on line 1040                                                                                              為什么我會收到此錯誤,我可以采取什么措施來避免它?
查看完整描述

4 回答

?
侃侃無極

TA貢獻(xiàn)2051條經(jīng)驗 獲得超10個贊

新聞:看來在您的composer.json中的沖突屬性處添加這些行是有效的!


"conflict": {

    "symfony/symfony": "*",

    "doctrine/common": ">=3.0",

    "doctrine/persistence": "<1.3"

},

所以我從今天早上就遇到了這個問題,我尋找解決方案但沒有找到它,所以我制作了自己的 DIY 解決方案,它對我來說很有效然后我將分享它:


首先,您需要進(jìn)入以下路徑并使用代碼編輯器打開其中的文件:


C:\YOUR_PROJECT\vendor\api-platform\core\src\Bridge\Doctrine\Orm\Metadata\Property\DoctrineOrmPropertyMetadataFactory.php

打開它后,您需要將第 19 行(use Doctrine\Common\Persistence\ManagerRegistry;)替換為以下行:


use Symfony\Bridge\Doctrine\ManagerRegistry;

這就是大家! 線路截圖


PS:如果您仍然遇到問題或未找到 Vendor\api-platform,您只需打開composer.json并臨時刪除以下行:


"cache:clear": "symfony-cmd",

并再次運(yùn)行命令:


composer req api


查看完整回答
反對 回復(fù) 2023-11-03
?
喵喵時光機(jī)

TA貢獻(xiàn)1846條經(jīng)驗 獲得超7個贊

從昨天開始我們就遇到了同樣的問題!我嘗試將捆綁包的版本更改為舊版本。但沒有任何成功的結(jié)果。

當(dāng)前依賴:

"api-platform/api-pack": "^1.2"

不過問題在GitHub上已經(jīng)解決了。待測試... https://github.com/symfony/symfony/issues/37936


更新:我們必須等待 api 平臺捆綁包的發(fā)布。 https://github.com/api-platform/core/issues/3683


查看完整回答
反對 回復(fù) 2023-11-03
?
qq_花開花謝_0

TA貢獻(xiàn)1835條經(jīng)驗 獲得超7個贊

暫時,您可以將其添加到composer.json:


"conflict": {

    ...

    "doctrine/common": ">=3.0",

    "doctrine/persistence": "<1.3"

}

這個對我有用。 https://github.com/api-platform/core/issues/3683#issuecomment-681039267


查看完整回答
反對 回復(fù) 2023-11-03
?
RISEBY

TA貢獻(xiàn)1856條經(jīng)驗 獲得超5個贊

我有同樣的問題,但是當(dāng)我添加以下行時

"conflict": { ... "doctrine/common": ">=3.0", "doctrine/persistence": "<1.3" } 在我的composer.json 文件中問題已解決


查看完整回答
反對 回復(fù) 2023-11-03
  • 4 回答
  • 0 關(guān)注
  • 282 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號