Spea / SpBowerBundle

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

sp:bower:install always returns "Bower returned an invalid dependency mapping" #39

Closed sattes-faction closed 11 years ago

sattes-faction commented 11 years ago

Sorry for flooding you with issues, but I simply can't get it to work. Im on Windows. First of all here's my SpBower config:

sp_bower:
    install_on_warmup: true
    bundles:
        AcmeDemoBundle:
          json_file: bower.json

My bower.json is:

{
    "name": "demo",
    "dependencies": {
        "bootstrap": "~2.3.2"
    }
}

My composer.json looks like (from the standard symfony installation):

{
    [...]
    "require": {
        [...]
        "sp/bower-bundle": "0.8.*@dev"
    },
    "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",
            "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",
            "Sp\\BowerBundle\\Composer\\ScriptHandler::bowerInstall"
        ]
    },
    [...]
}

Whenever I echo php app/console sp:bower:install I get the "Bower returned an invalid dependency mapping" message with bower 1.0.0. I already tried deleting the cache folders manually or running php app/console cache:clear and php app/console cache:clear --no-warmup - nothing worked.

I then deleted the components folder and it started to install but also echoed the same warning in the end:

bower bootstrap#~2.3.2      deprecated Package bootstrap is using the deprecated component.json file
bower bootstrap#~2.3.2      not-cached git://github.com/twitter/bootstrap.git#~2.3.2
bower bootstrap#~2.3.2         resolve git://github.com/twitter/bootstrap.git#~2.3.2
bower bootstrap#~2.3.2        download http://github.com/twitter/bootstrap/archive/v2.3.2.tar.gz
bower bootstrap#~2.3.2         extract archive.tar.gz
bower jquery#~1.8.0         deprecated Package jquery is using the deprecated component.json file
bower bootstrap#~2.3.2        resolved git://github.com/twitter/bootstrap.git#2.3.2
bower jquery#~1.8.0         not-cached git://github.com/components/jquery.git#~1.8.0
bower jquery#~1.8.0            resolve git://github.com/components/jquery.git#~1.8.0
bower jquery#~1.8.0           download http://github.com/components/jquery/archive/1.8.3.tar.gz
bower jquery#~1.8.0            extract archive.tar.gz
bower jquery#~1.8.0           resolved git://github.com/components/jquery.git#1.8.3
bower bootstrap#~2.3.2         install bootstrap#2.3.2
bower jquery#~1.8.0            install jquery#1.8.3

bootstrap#2.3.2 ..\..\..\..\src\Headwork\TwentyYearsBundle\Resources\public\components\bootstrap
ÔööÔöÇÔöÇ jquery#1.8.3

jquery#1.8.3 ..\..\..\..\src\Headwork\TwentyYearsBundle\Resources\public\components\jquery

  [Sp\BowerBundle\Bower\Exception\InvalidMappingException]
  Bower returned an invalid dependency mapping. This mostly happens when the dependencies are not yet installed or if you are using an old version of bower.
sattes-faction commented 11 years ago

Well, I don't know why, but suddenly it works. I'll investigate this further and reopen the ticket when I'm facing this issue again.

sattes-faction commented 11 years ago

Ok, it seems the issue was I echoed the sp:bower:install as sudo, which does not work properly.