douchi1945 2019-06-25 12:49
浏览 223

无法使用composer启动我自己的包

I am working with symfony4 and I want to create and use my own bundle.

I have created my own bundle following the tutorial: https://symfonycasts.com/screencast/symfony-bundle

I am encoutering a problem at the Chapter 09: Proper Bundle composer.json File.

I have followed all steps of this chapter. I've tried to launch the command composer require bon-coin-bundle:*@dev as indicated, but here are my errors:

  • "bon-coin-bundle" is not a valid alias. Did you mean this:
    "symfony/monolog-bundle", supported aliases: "monolog-bundle"

Thus I tried to launch other commands without better results: composer require ../bon-coin-bundle:*, composer require ../bon-coin-bundle:*@dev ...

I've edited the composer.json like this:

{
    "name": "bon-coin-bundle",
    "description": "Bon Coin",
    "type": "symfony-bundle",
    "license": "MIT",
    "authors": [
        {
            "name": "matodo",
            "email": "matodo@xxx.com"
        }
    ],
    "require": {
        "php": "^7.1.3"
    },
    "autoload": {
        "psr-4": {
            "bonCoinBundle\\": "bonCoinBundle"
        }
    }
}

(I am not really sure of what I've done for the autoload part, but I don't think that the problem comes frome there)

My folders are ranked like this: a bonCoinBundle folder contains DependencyInjections, Resources and services for my bundle. The folder bonCoinBundle is not in my current projet symfony.

bonCoinBundle
|- DependencyInjection
   Resources
   ...
symfonyProject
|- src 
   ...
  • 写回答

1条回答 默认 最新

  • douzuo0711 2019-06-25 12:59
    关注

    I don't know what means posting a bundle to packagist, but I've put this path in project's composer.json :

    "repositories": [
            {
                "type": "path",
                "url": "../bonCoinBundle"
            }
        ]
    
    
    评论

报告相同问题?

悬赏问题

  • ¥15 神经网络怎么把隐含层变量融合到损失函数中?
  • ¥30 自适应 LMS 算法实现 FIR 最佳维纳滤波器matlab方案
  • ¥15 lingo18勾选global solver求解使用的算法
  • ¥15 全部备份安卓app数据包括密码,可以复制到另一手机上运行
  • ¥15 Python3.5 相关代码写作
  • ¥20 测距传感器数据手册i2c
  • ¥15 RPA正常跑,cmd输入cookies跑不出来
  • ¥15 求帮我调试一下freefem代码
  • ¥15 matlab代码解决,怎么运行
  • ¥15 R语言Rstudio突然无法启动