Cmb2: composer install cmb2/cmb2 work wrong

Created on 22 May 2019  路  3Comments  路  Source: CMB2/CMB2

Expected Behavior:



When execute composer for install cmb2/cmb2 create a wp-content/plugins/cm2 folder in the main path and not in vendor/cmb2

Actual Behavior:



Before
/
|-vendor (empty)

composer file:

 "require": {
        "cmb2/cmb2": "dev-master",
        "composer/installers": "v1.0.12"
    },
"extra": {
        "installer-paths": {
        "vendor/{$name}/": ["cmb/cmb2"] 
        }
    }

Actual Result
/
|-vendor
|--composer
|-wp-content
|--plugins
|---cmb2 (the cmb2 content)

Possible Solution


When execute composer store te cmb2 in vendor folder

/
|-vendor
|--composer
|--cmb2 (the cmb2 content)

Most helpful comment

@cehojac

I had this same problem. My issue came up when I also required the composer/installers package (I'm guessing you're requiring this package too).

The solution was to add

    "extra": {
        "installer-paths": {
            "vendor/cmb2/cmb2": ["cmb2/cmb2"]
        }
    }

to my composer.json.

I have more information about how I figured this out in my blog post, CMB2 as a Dependency with Composer.

All 3 comments

@cehojac

I had this same problem. My issue came up when I also required the composer/installers package (I'm guessing you're requiring this package too).

The solution was to add

    "extra": {
        "installer-paths": {
            "vendor/cmb2/cmb2": ["cmb2/cmb2"]
        }
    }

to my composer.json.

I have more information about how I figured this out in my blog post, CMB2 as a Dependency with Composer.

@salcode Thank You, I deleted the composer/installers and work !

@cehojac I'm glad this is working for you now. I'm going to mark this issue as closed.

Feel free to re-open, if you think we should do anything further with this.

Thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jquimera picture jquimera  路  8Comments

apokyro picture apokyro  路  5Comments

GaryJones picture GaryJones  路  3Comments

yeahsmaggy picture yeahsmaggy  路  9Comments

tw2113 picture tw2113  路  8Comments