Add wordpress namespace for wordpress package issue

I manually updated Bedrock from 1.1.1 to 1.2.2.

Everything went fine except for the commit that added the Wordpress namespace to the Wordpress package.

After making that change I get the following error from composer update:
Only one package can be installed into the configured webroot.

which makes sense. I just can’t figure out how to reset the webroot so it works.

I tried deleting the wp directory and local Composer caches and that didn’t have an effect.

I know this is a minor change that isn’t even required.

This is a known issue I probably should have made a note about, but I figured most people wouldn’t actually update Bedrock since it’s an uncommon situation.

To fix it, you need to do the following:

  1. Delete vendor/ and wp/ dir
  2. Delete composer.lock
  3. Run composer install again

Since your vendor/ dir is managed by Composer, it shouldn’t do any damage to delete it. And just a note that deleting composer.lock and letting it re-generate could potentially update some versions of packages depending on how you defined them.

edit: Actually you may only need to delete your composer.lock file now that I think about it. Or maybe wp/ as well like you did. vendor/ shouldn’t even matter.

That was it - thanks!

I needed to delete the contents of the vendor/ directory as well as the wp directory and composer.lock file.