<p>I found the real root cause. A internal business plugin which I migrated from Craft 2 to Craft 3 had a composer.json file which required <code>composer/installers</code> and that little bugger was mucking up the whole thing. 
So if you find that in your composer.lock file for Craft 3, go in deep and find it!</p>

CC BY-SA 4.0
2019-07-12T12:39:01.997Z
2019-07-18T15:06:19.493Z
2019-07-18T15:06:19.493Z
Greg Bowne
<p>I've got Craft 3.1.32 up and running on dev machines and we're ready to get it into our test/stage enviromnments, which are built through a GitLab CI/CD. While doing this, we noticed some plugins wouldn't install and would throw a composer error: </p>

<blockquote>
  <p><code>[RuntimeException]</code><br>
  <code>craft/plugins/[plugin-name]/</code> does not exist and could not be created. </p>
</blockquote>

<p>Now, <code>craft/plugins</code> is the Craft 2 location for plugins, and that directory doesn't exist in Craft 3, right? I see there's a file that gets created called <code>/vendor/composer/installers/src/Composer/Installers/CraftInstaller.php</code> that has a reference to <code>craft/plugins/{$name}</code> so I'm guessing that this file is being invoked to do some quick stuff to clean  the plugin name. But I'm not sure what the directory is really doing.</p>

<p>Any ideas? </p>

<p>EDIT:
It looks like there's a nice file within the <code>composer/composer</code> repo that dates back to Craft 2: <a href="https://github.com/composer/installers/blob/master/src/Composer/Installers/CraftInstaller.php" rel="nofollow noreferrer">See CraftInstaller.php in GitHub</a> that is pointing at old directories</p>

<plugins><install><composer>
Composer require looking to craft/plugins/[plugin] directory but throws runtime error?
# Composer require looking to craft/plugins/[plugin] directory but throws runtime error?

(Asked by: username_0 on 2019-07-11)

I've got Craft 3.1.32 up and running on dev machines and we're ready to get it into our test/stage enviromnments, which are built through a GitLab CI/CD. While doing this, we noticed some plugins wouldn't install and would throw a composer error:

> `[RuntimeException]`  
> `craft/plugins/[plugin-name]/` does not exist and could not be created.

Now, `craft/plugins` is the Craft 2 location for plugins, and that directory doesn't exist in Craft 3, right? I see there's a file that gets created called `/vendor/composer/installers/src/Composer/Installers/CraftInstaller.php` that has a reference to `craft/plugins/{$name}` so I'm guessing that this file is being invoked to do some quick stuff to clean the plugin name. But I'm not sure what the directory is really doing.

Any ideas?

EDIT:
It looks like there's a nice file within the `composer/composer` repo that dates back to Craft 2: [See CraftInstaller.php in GitHub](https://github.com/composer/installers/blob/master/src/Composer/Installers/CraftInstaller.php) that is pointing at old directories

**Tags:** plugins, install, composer

---

## 1 answers

### Answer by username_0 on 2019-07-12. Score: 4

I found the real root cause. A internal business plugin which I migrated from Craft 2 to Craft 3 had a composer.json file which required `composer/installers` and that little bugger was mucking up the whole thing.
So if you find that in your composer.lock file for Craft 3, go in deep and find it!


---

