Closed blairwigley closed 3 years ago
Try issuing composer update -vvv
- you may see the download URL of the ACF plugin.
Thanks - this is the verbose output:
- Installing advanced-custom-fields/advanced-custom-fields-pro (5.9.1): Extracting archive
Executing command (CWD): rm -rf 'wp-content/plugins/advanced-custom-fields-pro/pro'
Executing command (CWD): rm -rf 'wp-content/plugins/advanced-custom-fields-pro/includes'
Executing command (CWD): rm -rf 'wp-content/plugins/advanced-custom-fields-pro/lang'
Executing command (CWD): rm -rf 'wp-content/plugins/advanced-custom-fields-pro/assets'
Executing async command (CWD): unzip -qq '/Users/me/Sites/mysite/wp-content/themes/mytheme/vendor/composer/tmp-da7f2d37aec8740be655dd57e403f1a7.php' -d '/Users/me/Sites/mysite/wp-content/themes/mytheme/vendor/composer/7655a7fd'
Executing command (CWD): rm -rf 'wp-content/plugins/advanced-custom-fields-pro'
Executing command (CWD): rm -rf '/Users/me/Sites/mysite/wp-content/themes/mytheme/vendor/composer/7655a7fd'
Executing command (CWD): rm -rf '/Users/me/Sites/mysite/wp-content/themes/mytheme/vendor/advanced-custom-fields/advanced-custom-fields-pro'
I've got the composer.json file in my theme so I though that could be an issue, but I'm getting the same results if I put it in the root of the WP install.
Any idea why it's removing vendor/advanced-custom-fields/advanced-custom-fields-pro with that last command?
I think your packages fight each other :)
Try with 2 files only: composer.json and .env in a new directory. Maybe with an empty cache...
e.g.
{
"type": "project",
"license": "proprietary",
"repositories": [
{
"type": "package",
"package": {
"type": "wordpress-plugin",
"name": "advanced-custom-fields/acf-pro",
"version": "5.9.1",
"dist": {
"url": "https://connect.advancedcustomfields.com/index.php?p=pro&a=download&t={%VERSION}&k={%ACF_PRO_KEY}",
"type": "zip"
},
"require": {
"composer/installers": "^1.4",
"ffraenz/private-composer-installer": "^5.0"
}
}
}
],
"require": {
"php": ">=7.2",
"advanced-custom-fields/acf-pro": "^5.8.7"
}
}
and ACF_PRO_KEY=***
in .env
I've noticed this with Composer 2, the package's vendor directory is always created (vendor/advanced-custom-fields
) but the package (of type wordpress-plugin
) will be installed (by default) in wp-content/plugins/advanced-custom-fields-pro
(which is what composer/installers does).
And that path could be customized!
Ah I didn't even notice the wp-content directory in my theme folder!
@szepeviktor how do I go about changing the install path?
how do I go about changing the install path?
@blairwigley Add an extra section to composer.json
.
"extra": {
"installer-paths": {
"public/wp-content/mu-plugins/{$name}/": [
"type:wordpress-muplugin"
],
"public/wp-content/plugins/{$name}/": [
"type:wordpress-plugin"
],
"public/wp-content/themes/{$name}/": [
"type:wordpress-theme"
]
}
},
Brilliant! Thanks so much for your help.
I'm trying to install ACF - everything seems to be running fine but the /vendor/advanced-custom-fields folder is empty.
Here is my package.json:
This is what composer update returns:
Any thoughts?