简体   繁体   English

运行 composer install 后 bin/console 丢失

[英]bin/console missing after running composer install

Hoping someone could help me out with this one please.希望有人能帮我解决这个问题。

My project (on github https://github.com/irvingswiftj/iceMarkt ) when running composer install, seems to run without a hitch, until running the post update commands.我的项目(在 github https://github.com/irvingswiftj/iceMarkt上)在运行 composer install 时,似乎运行顺利,直到运行更新后命令。 In which I end up with the following error (when adding param -vvv):我最终遇到以下错误(添加参数 -vvv 时):

    Updating the "app/config/parameters.yml" file
    Could not open input file: bin/console
    Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache handling the post-update-cmd event terminated with an exception

    [RuntimeException]                                                         
    An error occurred when executing the "'cache:clear --no-warmup'" command.  

If I now browse my project directory, I can see that bin/console is never created!如果我现在浏览我的项目目录,我可以看到 bin/console 从未创建!

Symfony 2 => app/console Symfony 2 => app / console

Symfony 3 => bin/console Symfony 3 => bin / console

I had deleted the bin directory assuming that the executable console file would be created in my next composer install. 假设在我的下一个作曲家安装中创建了可执行控制台文件,我删除了bin目录。 I was wrong! 我错了! Don't gitignore your bin/composer file and also make sure that if you are using the symfony 3 folder structure, you don't have .gitignore for the symfony 2 folder structure. 不要gitignore您的bin / composer文件,并确保如果您使用symfony 3文件夹结构,则没有.gitignore用于symfony 2文件夹结构。

Using Symfony 4 / Symfony Flex, you need to install the symfony/console package:使用 Symfony 4 / Symfony Flex,你需要安装symfony/console package:

composer require symfony/console

Then use from your project dir:然后从您的项目目录中使用:

./bin/console

As the file itself is starting with a shebang #!/usr/bin/env php you can execute it right away without php infront.由于文件本身以 shebang #!/usr/bin/env php ,因此您可以立即执行它,而无需前面的php

I had the same problem because I was accostumed to add the bin directory to my .gitignore file, because in Symfony2 all bin files (including the ones from other vendors) where placed in that folder, but that is not the case in Symfony3, so we can add the bin directory to our code repositories. 我有同样的问题,因为我被认为是将bin目录添加到我的.gitignore文件,因为在Symfony2中所有bin文件(包括来自其他供应商的文件)放在该文件夹中,但在Symfony3中不是这样,所以我们可以将bin目录添加到我们的代码库中。

You can solve problem installing a new application (using the symfony installer) and copying the bin directory from this new project to your own project. 您可以解决安装新应用程序的问题(使用symfony安装程序)并将bin目录从此新项目复制到您自己的项目。

With newer versions of Symfony and Flex installed,安装较新版本的 Symfony 和 Flex,

composer --force recipes:install symfony/console

This will bring bin/console into existence.这将使 bin/console 存在。 If it's already there but you need to update it, use如果它已经存在但您需要更新它,请使用

composer recipes:update symfony/console
composer recipes

Just lists your recipes.只是列出你的食谱。

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

相关问题 运行“Composer Install”后丢失“vendor”文件夹 - “vendor” folder missing after running “Composer Install” 为什么作曲家安装后在“bin”中找不到或重新创建 bin/console 脚本? - Why isn't bin/console script found nor recreated in “bin” after composer install? composer install 将命令行参数或参数传递给 bin/console - composer install pass command line argument or parameter to bin/console 如何在composer安装后运行Symfony控制台命令? - How do I run a Symfony Console command after composer install? 使用brew安装Composer后缺少供应商文件夹 - Vendor folder missing after using brew to install Composer 未能解决:执行程序运行失败[/bin/sh -c composer install]:退出代码:1 - failed to solve: executor failed running [/bin/sh -c composer install]: exit code: 1 在 Dockerfile 中运行 composer install - running composer install in Dockerfile OSX垃圾桶/控制台上的Sylius丢失 - Sylius on OSX bin/console missing 为什么在composer安装后我的composer.json会自动删除或丢失? - Why is my composer.json automatically deleted or missing after composer install? 运行“ composer update / install”后,如何正确更改作曲家或Symfony2的功能? - How to properly change what composer or Symfony2 does after running 'composer update/install'?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM