Spea / SpBowerBundle

Symfony2 Bundle to handle asset dependencies with bower
231 stars 44 forks source link

`composer install` failed at `asserts:install web` command after installing SpBowerBundle #72

Closed chrisyue closed 10 years ago

chrisyue commented 10 years ago

if I remove SpBowerBundle from AppKernel, everything works fine again

error message:

Reading ./composer.lock Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. Run update to update them. Nothing to install or update Generating autoload files Clearing the cache for the dev environment with debug true

[InvalidArgumentException]
The target directory "web" does not exist.

assets:install [--symlink] [--relative] [target]

Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::installAssets handling the post-install-cmd event terminated with an exception

[RuntimeException]
An error occurred when executing the "'assets:install '\''web'\'''" command.

log: [2014-01-05 14:22:54] event.DEBUG: Notified event "bower.pre_exec" to listener "Sp\BowerBundle\EventListener\ExecListener::onPreExec". [] {"project_name":"project"} [2014-01-05 14:22:54] event.DEBUG: Notified event "bower.post_exec" to listener "Sp\BowerBundle\EventListener\CacheCreateListener::onPostExec". [] {"project_name":"project"}

composer.json:

"scripts": {
    "post-install-cmd": [
        "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
        "Mopa\\Bundle\\BootstrapBundle\\Composer\\ScriptHandler::postInstallSymlinkTwitterBootstrap",
        "Sp\\BowerBundle\\Composer\\ScriptHandler::bowerInstall"
    ],
    "post-update-cmd": [
        "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
        "Mopa\\Bundle\\BootstrapBundle\\Composer\\ScriptHandler::postInstallSymlinkTwitterBootstrap",
        "Sp\\BowerBundle\\Composer\\ScriptHandler::bowerInstall"
    ]
},
Spea commented 10 years ago

Please post your configuration app/config/config.yml and your bower.json. It would be also interesting to know, what version of bower/symfony you are using.

chrisyue commented 10 years ago

thanks for your reply

this is the require section of my composer.json

    "php": ">=5.5.0",
    "symfony/symfony": "~2.4",
    "doctrine/orm": "~2.2,>=2.2.3",
    "doctrine/doctrine-bundle": "~1.2",
    "twig/extensions": "~1.0",
    "symfony/assetic-bundle": "~2.3",
    "symfony/swiftmailer-bundle": "~2.3",
    "symfony/monolog-bundle": "~2.4",
    "sensio/distribution-bundle": "~2.3",
    "sensio/framework-extra-bundle": "~3.0",
    "sensio/generator-bundle": "~2.3",
    "incenteev/composer-parameter-handler": "~2.0",
    "snc/redis-bundle": "1.1.*",
    "knplabs/knp-paginator-bundle": "dev-master",
    "friendsofsymfony/user-bundle": "dev-master",
    "hwi/oauth-bundle": "dev-master",
    "mopa/bootstrap-bundle": "2.3.x-dev",
    "knplabs/knp-paginator-bundle": "dev-master",
    "knplabs/knp-components": "1.2.x-dev",
    "knplabs/knp-menu": "dev-master",
    "knplabs/knp-menu-bundle": "dev-master",
    "jms/serializer-bundle": "0.13.*",
    "friendsofsymfony/rest-bundle": "1.1.*",
    "michelf/php-markdown": "1.3",
    "sp/bower-bundle": "dev-master",

here is my part of config.yml, nothing special

  sp_bower:
        bundles:
            MyWebBundle: ~
sstok commented 10 years ago

You must run the Bower and Mopa scripts before assets:install, or else they will not get installed properly. This especially true on Windows as symlink don't work there.

Spea commented 10 years ago

I think this one can be closed, if you still have this issue, create a new one please.