繁体   English   中英

无法实例化组件或 class “yii\gii\Module”

[英]Failed to instantiate component or class “yii\gii\Module”

我刚刚在 Mac 操作系统上创建了新的 Yii 2 应用程序。 我使用的 PHP 版本是7.3版本。 Composer 安装工作正常,但是当我尝试使用命令php yii serve启动应用程序时,出现以下错误。

Exception 'yii\base\InvalidConfigException' with message 'Failed to instantiate component or class "yii\gii\Module".'

in /Users/krishnadas/Desktop/thejas/lms/vendor/yiisoft/yii2/di/Container.php:449

Stack trace:
#0 /Users/krishnadas/Desktop/thejas/lms/vendor/yiisoft/yii2/di/Container.php(374): yii\di\Container->getDependencies('yii\\gii\\Module')
#1 /Users/krishnadas/Desktop/thejas/lms/vendor/yiisoft/yii2/di/Container.php(159): yii\di\Container->build('yii\\gii\\Module', Array, Array)
#2 /Users/krishnadas/Desktop/thejas/lms/vendor/yiisoft/yii2/BaseYii.php(365): yii\di\Container->get('yii\\gii\\Module', Array, Array)
#3 /Users/krishnadas/Desktop/thejas/lms/vendor/yiisoft/yii2/base/Module.php(427): yii\BaseYii::createObject(Array, Array)
#4 /Users/krishnadas/Desktop/thejas/lms/vendor/yiisoft/yii2/base/Application.php(315): yii\base\Module->getModule('gii')
#5 /Users/krishnadas/Desktop/thejas/lms/vendor/yiisoft/yii2/base/Application.php(273): yii\base\Application->bootstrap()
#6 /Users/krishnadas/Desktop/thejas/lms/vendor/yiisoft/yii2/console/Application.php(124): yii\base\Application->init()
#7 /Users/krishnadas/Desktop/thejas/lms/vendor/yiisoft/yii2/base/BaseObject.php(109): yii\console\Application->init()
#8 /Users/krishnadas/Desktop/thejas/lms/vendor/yiisoft/yii2/base/Application.php(206): yii\base\BaseObject->__construct(Array)
#9 /Users/krishnadas/Desktop/thejas/lms/vendor/yiisoft/yii2/console/Application.php(89): yii\base\Application->__construct(Array)
#10 /Users/krishnadas/Desktop/thejas/lms/yii(19): yii\console\Application->__construct(Array)
#11 {main}

当我运行 composer update 我得到更多这样的错误

 ailed to extract yiisoft/yii2-bootstrap: (9) unzip -qq  '/Users/krishnadas/Desktop/thejas/basic/vendor/composer/tmp-26e4a5cb7b14ec2c9244cc7f29b77c9d' -d '/Users/krishnadas/Desktop/thejas/basic/vendor/composer/63a3aea5'
    
    unzip:  cannot find or open /Users/krishnadas/Desktop/thejas/basic/vendor/composer/tmp-26e4a5cb7b14ec2c9244cc7f29b77c9d.
    
        This most likely is due to a custom installer plugin not handling the returned Promise from the downloader
        See https://github.com/composer/installers/commit/5006d0c28730ade233a8f42ec31ac68fb1c5c9bb for an example fix
        Failed to extract yiisoft/yii2-debug: (9) unzip -qq  '/Users/krishnadas/Desktop/thejas/basic/vendor/composer/tmp-ee4e9bc3f65bc1e6d3bb29c47448147f' -d '/Users/krishnadas/Desktop/thejas/basic/vendor/composer/c3a14115'

unzip:  cannot find or open /Users/krishnadas/Desktop/thejas/basic/vendor/composer/tmp-ee4e9bc3f65bc1e6d3bb29c47448147f.

    This most likely is due to a custom installer plugin not handling the returned Promise from the downloader
    See https://github.com/composer/installers/commit/5006d0c28730ade233a8f42ec31ac68fb1c5c9bb for an example fix
    Failed to extract yiisoft/yii2-faker: (9) unzip -qq  '/Users/krishnadas/Desktop/thejas/basic/vendor/composer/tmp-adfed1b28e8eb6386664db1dc98849ab' -d '/Users/krishnadas/Desktop/thejas/basic/vendor/composer/d8990f9a'

unzip:  cannot find or open /Users/krishnadas/Desktop/thejas/basic/vendor/composer/tmp-adfed1b28e8eb6386664db1dc98849ab.

    This most likely is due to a custom installer plugin not handling the returned Promise from the downloader
    See https://github.com/composer/installers/commit/5006d0c28730ade233a8f42ec31ac68fb1c5c9bb for an example fix
    Failed to extract yiisoft/yii2-gii: (9) unzip -qq  '/Users/krishnadas/Desktop/thejas/basic/vendor/composer/tmp-a51d0a4cc1fef91725fe727eb3a41a43' -d '/Users/krishnadas/Desktop/thejas/basic/vendor/composer/eaed0437'

unzip:  cannot find or open /Users/krishnadas/Desktop/thejas/basic/vendor/composer/tmp-a51d0a4cc1fef91725fe727eb3a41a43.

    This most likely is due to a custom installer plugin not handling the returned Promise from the downloader
    See https://github.com/composer/installers/commit/5006d0c28730ade233a8f42ec31ac68fb1c5c9bb for an example fix
    Failed to extract yiisoft/yii2-swiftmailer: (9) unzip -qq  '/Users/krishnadas/Desktop/thejas/basic/vendor/composer/tmp-d3e0c5f68aded7a5357259ffde56f5ea' -d '/Users/krishnadas/Desktop/thejas/basic/vendor/composer/3514a4ce'

unzip:  cannot find or open /Users/krishnadas/Desktop/thejas/basic/vendor/composer/tmp-d3e0c5f68aded7a5357259ffde56f5ea.

    This most likely is due to a custom installer plugin not handling the returned Promise from the downloader
    See https://github.com/composer/installers/commit/5006d0c28730ade233a8f42ec31ac68fb1c5c9bb for an example fix`

当我将作曲家降级到最新的稳定版本1.10.7时,它终于起作用了。 版本2的某些安装项目(例如gii )存在问题。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM