Answers.Body: <p>The article I wrote <a href="https://nystudio107.com/blog/so-you-wanna-make-a-craft-3-plugin" rel="nofollow noreferrer">So You Wanna Make a Craft 3 Plugin?</a> may help you in terms of figuring out how to properly set up a "host" website to run your plugin development from.</p>
  
  <p>TL;DR your repo shouldn't point to your site's vendor directory, it should point to wherever that plugin exists on your local dev environment.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-03-19T00:20:57.367Z
Answers.Text: Thanks for that. I was all messed up in where I was putting files. You are correct. The plug in files should exist outside of craft and then composer  sets things up in vendor.
Answers.UserDisplayName: Eric Snyder
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-03-19T00:01:09.993Z
Answers.LastActivityDate: 2018-03-19T00:01:09.993Z
Answers.UserDisplayName: andrew.welch
Answers.Body: <p>The composer adds all necessary files into the vendor directory. You should never implement files there on your own so you should create a <code>plugins</code> folder next to your vendor folder and insert the files there. Your path parameter will then be <code>/plugins/recoveryfinder/nav</code></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-03-18T23:28:21.367Z
Answers.LastActivityDate: 2018-03-18T23:28:21.367Z
Answers.UserDisplayName: Robin Schambach
Body: <p>I am starting to play with writing a plugin in Craft 3.0. I have followed the following <a href="https://github.com/craftcms/docs/blob/v3/en/plugin-intro.md" rel="nofollow noreferrer">page</a>. I used <a href="https://pluginfactory.io/" rel="nofollow noreferrer">Plugin Factory</a> to create my plugin structure (very nice). My folder structure is as follows:</p>
  
  <pre><code>/craft
  /craft/vendor/recoveryfinder/nav
  </code></pre>
  
  <p>I uploaded the files and folders created bt the pluginfactury to /craft/vendor/recoveryfinder/nav folder. My additions to the craft project composer.json look like this:</p>
  
  <p>After:</p>
  
  <pre><code>{
    "name": "craftcms/craft",
    "description": "Craft CMS",
  </code></pre>
  
  <p>I added:</p>
  
  <pre><code>  "minimum-stability": "dev",
    "prefer-stable": true,
  </code></pre>
  
  <p>After:</p>
  
  <pre><code>  "scripts": {
      "post-root-package-install": [
        "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
      ],
      "post-create-project-cmd": [
        "@composer dump-autoload -o",
        "@php craft setup/welcome"
      ]
    },
  </code></pre>
  
  <p>I added:</p>
  
  <pre><code>  "repositories": [
      {
        "type": "path",
        "url": "./vendor/recoveryfinder/nav"
      }
    ]
  </code></pre>
  
  <p>I went to the terminal logged in as the user that owns the files and change location to:</p>
  
  <blockquote>
    <p>/craft</p>
  </blockquote>
  
  <p>I then ran:</p>
  
  <blockquote>
    <p>composer require recoveryfinder/nav</p>
  </blockquote>
  
  <p>The output I am getting is:</p>
  
  <pre><code>Using version ^0.9.0 for recoveryfinder/nav
  ./composer.json has been updated
  Loading composer repositories with package information
  Updating dependencies (including require-dev)
  Package operations: 1 install, 0 updates, 0 removals
  
  
    [RuntimeException]
    Package recoveryfinder/nav cannot install to "/home/recoveryfinder/craft/vendor/recoveryfinder/nav" inside its source at "/home/recoveryfinder/craft/
    vendor/recoveryfinder/nav"
  
  
  require [--dev] [--prefer-source] [--prefer-dist] [--no-progress] [--no-suggest] [--no-update] [--no-scripts] [--update-no-dev] [--update-with-dependencies] [--update-with-all-dependencies] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [--sort-packages] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--] [&lt;packages&gt;]...
  </code></pre>
  
  <p>I have not modified in any way the files created by pluginfactory.io.</p>
  
  <p>Any pointers as to what I did wrong?</p>
  
Tags: <plugin-development><craft3><composer>
Title: Problem installing plugin via path repository
ThreadText: # Problem installing plugin via path repository
  
  (Asked by: username_0 on 2018-03-18)
  
  I am starting to play with writing a plugin in Craft 3.0. I have followed the following [page](https://github.com/craftcms/docs/blob/v3/en/plugin-intro.md). I used [Plugin Factory](https://pluginfactory.io/) to create my plugin structure (very nice). My folder structure is as follows:
  
  ```
  /craft
  /craft/vendor/recoveryfinder/nav
  
  ```
  
  I uploaded the files and folders created bt the pluginfactury to /craft/vendor/recoveryfinder/nav folder. My additions to the craft project composer.json look like this:
  
  After:
  
  ```
  {
    "name": "craftcms/craft",
    "description": "Craft CMS",
  
  ```
  
  I added:
  
  ```
    "minimum-stability": "dev",
    "prefer-stable": true,
  
  ```
  
  After:
  
  ```
    "scripts": {
      "post-root-package-install": [
        "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
      ],
      "post-create-project-cmd": [
        "@composer dump-autoload -o",
        "@php craft setup/welcome"
      ]
    },
  
  ```
  
  I added:
  
  ```
    "repositories": [
      {
        "type": "path",
        "url": "./vendor/recoveryfinder/nav"
      }
    ]
  
  ```
  
  I went to the terminal logged in as the user that owns the files and change location to:
  
  > /craft
  
  I then ran:
  
  > composer require recoveryfinder/nav
  
  The output I am getting is:
  
  ```
  Using version ^0.9.0 for recoveryfinder/nav
  ./composer.json has been updated
  Loading composer repositories with package information
  Updating dependencies (including require-dev)
  Package operations: 1 install, 0 updates, 0 removals
  
    [RuntimeException]
    Package recoveryfinder/nav cannot install to "/home/recoveryfinder/craft/vendor/recoveryfinder/nav" inside its source at "/home/recoveryfinder/craft/
    vendor/recoveryfinder/nav"
  
  require [--dev] [--prefer-source] [--prefer-dist] [--no-progress] [--no-suggest] [--no-update] [--no-scripts] [--update-no-dev] [--update-with-dependencies] [--update-with-all-dependencies] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [--sort-packages] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--] [<packages>]...
  
  ```
  
  I have not modified in any way the files created by pluginfactory.io.
  
  Any pointers as to what I did wrong?
  
  **Tags:** plugin-development, craft3, composer
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2018-03-19. Score: 3 | Accepted answer
  
  The article I wrote [So You Wanna Make a Craft 3 Plugin?](https://nystudio107.com/blog/so-you-wanna-make-a-craft-3-plugin) may help you in terms of figuring out how to properly set up a "host" website to run your plugin development from.
  
  TL;DR your repo shouldn't point to your site's vendor directory, it should point to wherever that plugin exists on your local dev environment.
  
  > **Comments:**
  > **username_0**: Thanks for that. I was all messed up in where I was putting files. You are correct. The plug in files should exist outside of craft and then composer  sets things up in vendor.  
  
  ---
  
  ### Answer by username_2 on 2018-03-18. Score: 2
  
  The composer adds all necessary files into the vendor directory. You should never implement files there on your own so you should create a `plugins` folder next to your vendor folder and insert the files there. Your path parameter will then be `/plugins/recoveryfinder/nav`
  
  
  ---
  
  