Symfony部署:使用composer install --no-dev的错误代码255

时间:2019-03-29 22:54:32

标签: symfony composer-php symfony4

以下是步骤,我正在遵循:

从github克隆我的存储库

git clone https://github.com/EresDev/EresNoteSymfony.git .

使用APP_ENV = prod更新.env文件

然后执行安装

composer install --no-dev

我收到以下错误:

.
.
.
  - Installing symfony/translation (v4.2.4): Loading from cache
  - Installing symfony/validator (v4.2.4): Loading from cache
  - Installing symfony/yaml (v4.2.4): Loading from cache
Generating autoload files
ocramius/package-versions:  Generating version class...
ocramius/package-versions: ...done generating version class
Executing script cache:clear [KO]
 [KO]
Script cache:clear returned with error code 255
!!  
Script @auto-scripts was called via post-install-cmd

但是,如果我只使用composer install而没有--no-dev

我该怎么做才能使其与--no-dev一起使用

如果需要,请参阅repository来访问代码。

1 个答案:

答案 0 :(得分:1)

显然,您已经设法以某种方式关闭了错误显示(或默认设置)。当我运行composer install --no-dev(使用commit e722218 ...运行)时,我收到一条非常不同的错误消息

!!  PHP Fatal error:  Uncaught Symfony\Component\Debug\Exception\ClassNotFoundException: Attempted to load class "TwigBundle" from namespace "Symfony\Bundle\TwigBundle".
!!  Did you forget a "use" statement for another namespace? in [path]/EresNoteSymfony/src/Kernel.php:23
!!  Stack trace:
!!  #0 [path]/EresNoteSymfony/vendor/symfony/http-kernel/Kernel.php(424): App\Kernel->registerBundles()
!!  #1 [path]/EresNoteSymfony/vendor/symfony/http-kernel/Kernel.php(130): Symfony\Component\HttpKernel\Kernel->initializeBundles()
!!  #2 [path]/EresNoteSymfony/vendor/symfony/framework-bundle/Console/Application.php(65): Symfony\Component\HttpKernel\Kernel->boot()
!!  #3 [path]/EresNoteSymfony/vendor/symfony/console/Application.php(145): Symfony\Bundle\FrameworkBundle\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
!!  #4 [path]/EresNoteSymfony/bin/console(38): Symfony\Component\Console\Application->run(Object(Symfony\Componen in [path]/EresNoteSymfony/src/Kernel.php on line 23
!!  

您应该以某种方式打开错误显示; o)

更新

您的config / bundles.php:6说:

Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true],

从本质上说,twigbundle在产品和开发中都可以使用。因此错误? (但是无论如何,这一点仍然存在,在cli上运行时应该显示错误)

我想在更改bundles.php中的那一行之后,必须将twig.yaml配置移动到dev / test文件夹中。