composer show dev packages and non dev packagesHow to remove a package from Laravel using composer?Using Composer to install npm and bower packages on production (i.e. no devDependencies)Composer autoload full example?How do I include a composer package into plain php?Composer autoload a package if a condition is metI can't flag my composer development as stableWhy can't I change a composer package namepace?Laravel Update / install composer packageComposer, Could not find a version of packageOptional sub-package in a Composer package?

Is there an in-universe explanation of how Frodo's arrival in Valinor was recorded in the Red Book?

SOQL injection vulnerability issue

What is the difference between increasing volume and increasing gain?

PhD Length: are shorter PhD degrees (from different countries) valued differently in other counter countries where PhD Is a longer process?

Looking for circuit board material that can be dissolved

Meaning of "fin" in "fin dai tempi"

Lighthouse Alternatives

What does "execute a hard copy" mean?

Do jackscrews suffer from blowdown?

What is the point of impeaching Trump?

Booting Ubuntu from USB drive on MSI motherboard -- EVERYTHING fails

How to "Start as close to the end as possible", and why to do so?

Short story about a potato hotel that makes its guests into potatoes throughout the night

How deep is the liquid in a half-full hemisphere?

Why do personal finance apps focus on outgoings rather than income

Are there types of animals that can't make the trip to space? (physiologically)

Can anyone give me the reason why music is taught this way?

Is spot metering just an EV compensation?

Isn't the detector always measuring, and thus always collapsing the state?

The answer is a girl's name (my future granddaughter) - can anyone help?

Confusion regarding control system of Mars Rover?

Did Tolkien ever write about a Heaven or Hell for Men?

Garage door sticks on a bolt

Is there anything on the ISS that would be destroyed if that object were returned to Earth?



composer show dev packages and non dev packages


How to remove a package from Laravel using composer?Using Composer to install npm and bower packages on production (i.e. no devDependencies)Composer autoload full example?How do I include a composer package into plain php?Composer autoload a package if a condition is metI can't flag my composer development as stableWhy can't I change a composer package namepace?Laravel Update / install composer packageComposer, Could not find a version of packageOptional sub-package in a Composer package?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty
margin-bottom:0;









1















Is there any way to know what packages will/will not be autoloaded when using the --no-dev flag?



I have inherited some code that uses composer and Im unsure what packages are included in the production build and what are only included in the dev build.



Since doing composer dump-autoload --no-dev gives me errors regarding missing classes I suspect that some packages are flagged as dev-only when they should not and I'm trying to track those down.



I havent found anything in the composer docs to help me doing this.










share|improve this question






























    1















    Is there any way to know what packages will/will not be autoloaded when using the --no-dev flag?



    I have inherited some code that uses composer and Im unsure what packages are included in the production build and what are only included in the dev build.



    Since doing composer dump-autoload --no-dev gives me errors regarding missing classes I suspect that some packages are flagged as dev-only when they should not and I'm trying to track those down.



    I havent found anything in the composer docs to help me doing this.










    share|improve this question


























      1












      1








      1


      1






      Is there any way to know what packages will/will not be autoloaded when using the --no-dev flag?



      I have inherited some code that uses composer and Im unsure what packages are included in the production build and what are only included in the dev build.



      Since doing composer dump-autoload --no-dev gives me errors regarding missing classes I suspect that some packages are flagged as dev-only when they should not and I'm trying to track those down.



      I havent found anything in the composer docs to help me doing this.










      share|improve this question














      Is there any way to know what packages will/will not be autoloaded when using the --no-dev flag?



      I have inherited some code that uses composer and Im unsure what packages are included in the production build and what are only included in the dev build.



      Since doing composer dump-autoload --no-dev gives me errors regarding missing classes I suspect that some packages are flagged as dev-only when they should not and I'm trying to track those down.



      I havent found anything in the composer docs to help me doing this.







      php composer-php






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 28 at 20:54









      Joaquin BrandanJoaquin Brandan

      8791 gold badge9 silver badges17 bronze badges




      8791 gold badge9 silver badges17 bronze badges

























          2 Answers
          2






          active

          oldest

          votes


















          2
















          The easiest way to check which packages are dev-only is to run composer install (this will install all dependencies, including dev-only) and then composer install --no-dev (this will remove dev-only dependencies). Last command will give you list of removed dependencies - these are packages not available in production builds, you should not rely on them (or move them to require section in your composer.json).



          Example:



          $ composer install
          Loading composer repositories with package information
          Installing dependencies (including require-dev) from lock file
          Package operations: 56 installs, 0 updates, 0 removals
          - Installing yiisoft/yii2-composer (2.0.7): Loading from cache
          - Installing bower-asset/jquery (3.3.1): Loading from cache
          - Installing bower-asset/bootstrap (v3.4.1): Loading from cache
          - Installing bower-asset/inputmask (3.3.11): Loading from cache
          - Installing bower-asset/punycode (v1.3.2): Loading from cache
          - Installing bower-asset/yii2-pjax (2.0.7.1): Loading from cache
          - Installing cebe/markdown (1.2.1): Loading from cache
          - Installing ezyang/htmlpurifier (v4.10.0): Loading from cache
          - Installing yiisoft/yii2 (2.0.17): Loading from cache
          - Installing swiftmailer/swiftmailer (v5.4.12): Loading from cache
          - Installing yiisoft/yii2-swiftmailer (2.0.7): Loading from cache
          - Installing symfony/polyfill-ctype (v1.11.0): Loading from cache
          - Installing symfony/yaml (v2.8.49): Loading from cache
          - Installing symfony/finder (v2.8.49): Loading from cache
          - Installing symfony/event-dispatcher (v2.8.49): Loading from cache
          - Installing symfony/polyfill-mbstring (v1.11.0): Loading from cache
          - Installing symfony/dom-crawler (v2.8.49): Loading from cache
          - Installing symfony/css-selector (v2.8.49): Loading from cache
          - Installing psr/log (1.1.0): Loading from cache
          - Installing symfony/debug (v2.8.49): Loading from cache
          - Installing symfony/console (v2.8.49): Loading from cache
          - Installing symfony/browser-kit (v2.8.49): Loading from cache
          - Installing ralouphie/getallheaders (2.0.5): Loading from cache
          - Installing psr/http-message (1.0.1): Loading from cache
          - Installing guzzlehttp/psr7 (1.5.2): Loading from cache
          - Installing sebastian/recursion-context (1.0.5): Loading from cache
          - Installing sebastian/exporter (1.2.2): Loading from cache
          - Installing phpunit/php-text-template (1.2.1): Loading from cache
          - Installing doctrine/instantiator (1.0.5): Loading from cache
          - Installing phpunit/phpunit-mock-objects (2.3.8): Loading from cache
          - Installing codeception/stub (1.0.4): Loading from cache
          - Installing sebastian/diff (1.4.3): Loading from cache
          - Installing sebastian/comparator (1.2.4): Loading from cache
          - Installing sebastian/version (1.0.6): Loading from cache
          - Installing sebastian/global-state (1.1.1): Loading from cache
          - Installing sebastian/environment (1.3.8): Loading from cache
          - Installing phpunit/php-timer (1.0.9): Loading from cache
          - Installing phpunit/php-file-iterator (1.4.5): Loading from cache
          - Installing phpunit/php-token-stream (1.4.12): Loading from cache
          - Installing phpunit/php-code-coverage (2.2.4): Loading from cache
          - Installing phpdocumentor/reflection-docblock (2.0.5): Loading from cache
          - Installing phpspec/prophecy (1.8.0): Loading from cache
          - Installing phpunit/phpunit (4.8.36): Loading from cache
          - Installing codeception/phpunit-wrapper (6.0.10): Loading from cache
          - Installing behat/gherkin (v4.6.0): Loading from cache
          - Installing codeception/base (2.4.1): Loading from cache
          - Installing myclabs/deep-copy (1.6.1): Loading from cache
          - Installing codeception/specify (0.4.6): Loading from cache
          - Installing codeception/verify (0.3.3): Loading from cache
          - Installing yiisoft/yii2-bootstrap (2.0.9): Loading from cache
          - Installing yiisoft/yii2-debug (2.0.14): Loading from cache
          - Installing fzaninotto/faker (v1.8.0): Loading from cache
          - Installing yiisoft/yii2-faker (2.0.4): Loading from cache
          - Installing phpspec/php-diff (v1.1.0): Loading from cache
          - Installing bower-asset/typeahead.js (v0.11.1): Loading from cache
          - Installing yiisoft/yii2-gii (2.0.8): Loading from cache
          Generating autoload files


          And then list of dev-only dependencies:



          $ composer install --no-dev
          Loading composer repositories with package information
          Installing dependencies from lock file
          Package operations: 0 installs, 0 updates, 44 removals
          - Removing yiisoft/yii2-gii (2.0.8)
          - Removing yiisoft/yii2-faker (2.0.4)
          - Removing yiisoft/yii2-debug (2.0.14)
          - Removing symfony/yaml (v2.8.49)
          - Removing symfony/polyfill-mbstring (v1.11.0)
          - Removing symfony/polyfill-ctype (v1.11.0)
          - Removing symfony/finder (v2.8.49)
          - Removing symfony/event-dispatcher (v2.8.49)
          - Removing symfony/dom-crawler (v2.8.49)
          - Removing symfony/debug (v2.8.49)
          - Removing symfony/css-selector (v2.8.49)
          - Removing symfony/console (v2.8.49)
          - Removing symfony/browser-kit (v2.8.49)
          - Removing sebastian/version (1.0.6)
          - Removing sebastian/recursion-context (1.0.5)
          - Removing sebastian/global-state (1.1.1)
          - Removing sebastian/exporter (1.2.2)
          - Removing sebastian/environment (1.3.8)
          - Removing sebastian/diff (1.4.3)
          - Removing sebastian/comparator (1.2.4)
          - Removing ralouphie/getallheaders (2.0.5)
          - Removing psr/log (1.1.0)
          - Removing psr/http-message (1.0.1)
          - Removing phpunit/phpunit-mock-objects (2.3.8)
          - Removing phpunit/phpunit (4.8.36)
          - Removing phpunit/php-token-stream (1.4.12)
          - Removing phpunit/php-timer (1.0.9)
          - Removing phpunit/php-text-template (1.2.1)
          - Removing phpunit/php-file-iterator (1.4.5)
          - Removing phpunit/php-code-coverage (2.2.4)
          - Removing phpspec/prophecy (1.8.0)
          - Removing phpspec/php-diff (v1.1.0)
          - Removing phpdocumentor/reflection-docblock (2.0.5)
          - Removing myclabs/deep-copy (1.6.1)
          - Removing guzzlehttp/psr7 (1.5.2)
          - Removing fzaninotto/faker (v1.8.0)
          - Removing doctrine/instantiator (1.0.5)
          - Removing codeception/verify (0.3.3)
          - Removing codeception/stub (1.0.4)
          - Removing codeception/specify (0.4.6)
          - Removing codeception/phpunit-wrapper (6.0.10)
          - Removing codeception/base (2.4.1)
          - Removing bower-asset/typeahead.js (v0.11.1)
          - Removing behat/gherkin (v4.6.0)
          Generating autoload files



          There is also a maglnet/composer-require-checker which may be useful for detecting usage of libraries not listed in require section.






          share|improve this answer


































            1
















            Basically, any package (and its dependencies) in require-dev section of your composer.json file will not be autoloaded when you use composer dump-autoload --no-dev. Sadly, I don't think there's a command to show those packages together with their dependencies as a single list.



            What you can do is try moving each of the packages from require-dev section to require, reruning composer update and composer dump-autoload --no-dev to see when your error disappears.






            share|improve this answer


























              Your Answer






              StackExchange.ifUsing("editor", function ()
              StackExchange.using("externalEditor", function ()
              StackExchange.using("snippets", function ()
              StackExchange.snippets.init();
              );
              );
              , "code-snippets");

              StackExchange.ready(function()
              var channelOptions =
              tags: "".split(" "),
              id: "1"
              ;
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function()
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled)
              StackExchange.using("snippets", function()
              createEditor();
              );

              else
              createEditor();

              );

              function createEditor()
              StackExchange.prepareEditor(
              heartbeatType: 'answer',
              autoActivateHeartbeat: false,
              convertImagesToLinks: true,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: 10,
              bindNavPrevention: true,
              postfix: "",
              imageUploader:
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              ,
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              );



              );














              draft saved

              draft discarded
















              StackExchange.ready(
              function ()
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55406710%2fcomposer-show-dev-packages-and-non-dev-packages%23new-answer', 'question_page');

              );

              Post as a guest















              Required, but never shown

























              2 Answers
              2






              active

              oldest

              votes








              2 Answers
              2






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              2
















              The easiest way to check which packages are dev-only is to run composer install (this will install all dependencies, including dev-only) and then composer install --no-dev (this will remove dev-only dependencies). Last command will give you list of removed dependencies - these are packages not available in production builds, you should not rely on them (or move them to require section in your composer.json).



              Example:



              $ composer install
              Loading composer repositories with package information
              Installing dependencies (including require-dev) from lock file
              Package operations: 56 installs, 0 updates, 0 removals
              - Installing yiisoft/yii2-composer (2.0.7): Loading from cache
              - Installing bower-asset/jquery (3.3.1): Loading from cache
              - Installing bower-asset/bootstrap (v3.4.1): Loading from cache
              - Installing bower-asset/inputmask (3.3.11): Loading from cache
              - Installing bower-asset/punycode (v1.3.2): Loading from cache
              - Installing bower-asset/yii2-pjax (2.0.7.1): Loading from cache
              - Installing cebe/markdown (1.2.1): Loading from cache
              - Installing ezyang/htmlpurifier (v4.10.0): Loading from cache
              - Installing yiisoft/yii2 (2.0.17): Loading from cache
              - Installing swiftmailer/swiftmailer (v5.4.12): Loading from cache
              - Installing yiisoft/yii2-swiftmailer (2.0.7): Loading from cache
              - Installing symfony/polyfill-ctype (v1.11.0): Loading from cache
              - Installing symfony/yaml (v2.8.49): Loading from cache
              - Installing symfony/finder (v2.8.49): Loading from cache
              - Installing symfony/event-dispatcher (v2.8.49): Loading from cache
              - Installing symfony/polyfill-mbstring (v1.11.0): Loading from cache
              - Installing symfony/dom-crawler (v2.8.49): Loading from cache
              - Installing symfony/css-selector (v2.8.49): Loading from cache
              - Installing psr/log (1.1.0): Loading from cache
              - Installing symfony/debug (v2.8.49): Loading from cache
              - Installing symfony/console (v2.8.49): Loading from cache
              - Installing symfony/browser-kit (v2.8.49): Loading from cache
              - Installing ralouphie/getallheaders (2.0.5): Loading from cache
              - Installing psr/http-message (1.0.1): Loading from cache
              - Installing guzzlehttp/psr7 (1.5.2): Loading from cache
              - Installing sebastian/recursion-context (1.0.5): Loading from cache
              - Installing sebastian/exporter (1.2.2): Loading from cache
              - Installing phpunit/php-text-template (1.2.1): Loading from cache
              - Installing doctrine/instantiator (1.0.5): Loading from cache
              - Installing phpunit/phpunit-mock-objects (2.3.8): Loading from cache
              - Installing codeception/stub (1.0.4): Loading from cache
              - Installing sebastian/diff (1.4.3): Loading from cache
              - Installing sebastian/comparator (1.2.4): Loading from cache
              - Installing sebastian/version (1.0.6): Loading from cache
              - Installing sebastian/global-state (1.1.1): Loading from cache
              - Installing sebastian/environment (1.3.8): Loading from cache
              - Installing phpunit/php-timer (1.0.9): Loading from cache
              - Installing phpunit/php-file-iterator (1.4.5): Loading from cache
              - Installing phpunit/php-token-stream (1.4.12): Loading from cache
              - Installing phpunit/php-code-coverage (2.2.4): Loading from cache
              - Installing phpdocumentor/reflection-docblock (2.0.5): Loading from cache
              - Installing phpspec/prophecy (1.8.0): Loading from cache
              - Installing phpunit/phpunit (4.8.36): Loading from cache
              - Installing codeception/phpunit-wrapper (6.0.10): Loading from cache
              - Installing behat/gherkin (v4.6.0): Loading from cache
              - Installing codeception/base (2.4.1): Loading from cache
              - Installing myclabs/deep-copy (1.6.1): Loading from cache
              - Installing codeception/specify (0.4.6): Loading from cache
              - Installing codeception/verify (0.3.3): Loading from cache
              - Installing yiisoft/yii2-bootstrap (2.0.9): Loading from cache
              - Installing yiisoft/yii2-debug (2.0.14): Loading from cache
              - Installing fzaninotto/faker (v1.8.0): Loading from cache
              - Installing yiisoft/yii2-faker (2.0.4): Loading from cache
              - Installing phpspec/php-diff (v1.1.0): Loading from cache
              - Installing bower-asset/typeahead.js (v0.11.1): Loading from cache
              - Installing yiisoft/yii2-gii (2.0.8): Loading from cache
              Generating autoload files


              And then list of dev-only dependencies:



              $ composer install --no-dev
              Loading composer repositories with package information
              Installing dependencies from lock file
              Package operations: 0 installs, 0 updates, 44 removals
              - Removing yiisoft/yii2-gii (2.0.8)
              - Removing yiisoft/yii2-faker (2.0.4)
              - Removing yiisoft/yii2-debug (2.0.14)
              - Removing symfony/yaml (v2.8.49)
              - Removing symfony/polyfill-mbstring (v1.11.0)
              - Removing symfony/polyfill-ctype (v1.11.0)
              - Removing symfony/finder (v2.8.49)
              - Removing symfony/event-dispatcher (v2.8.49)
              - Removing symfony/dom-crawler (v2.8.49)
              - Removing symfony/debug (v2.8.49)
              - Removing symfony/css-selector (v2.8.49)
              - Removing symfony/console (v2.8.49)
              - Removing symfony/browser-kit (v2.8.49)
              - Removing sebastian/version (1.0.6)
              - Removing sebastian/recursion-context (1.0.5)
              - Removing sebastian/global-state (1.1.1)
              - Removing sebastian/exporter (1.2.2)
              - Removing sebastian/environment (1.3.8)
              - Removing sebastian/diff (1.4.3)
              - Removing sebastian/comparator (1.2.4)
              - Removing ralouphie/getallheaders (2.0.5)
              - Removing psr/log (1.1.0)
              - Removing psr/http-message (1.0.1)
              - Removing phpunit/phpunit-mock-objects (2.3.8)
              - Removing phpunit/phpunit (4.8.36)
              - Removing phpunit/php-token-stream (1.4.12)
              - Removing phpunit/php-timer (1.0.9)
              - Removing phpunit/php-text-template (1.2.1)
              - Removing phpunit/php-file-iterator (1.4.5)
              - Removing phpunit/php-code-coverage (2.2.4)
              - Removing phpspec/prophecy (1.8.0)
              - Removing phpspec/php-diff (v1.1.0)
              - Removing phpdocumentor/reflection-docblock (2.0.5)
              - Removing myclabs/deep-copy (1.6.1)
              - Removing guzzlehttp/psr7 (1.5.2)
              - Removing fzaninotto/faker (v1.8.0)
              - Removing doctrine/instantiator (1.0.5)
              - Removing codeception/verify (0.3.3)
              - Removing codeception/stub (1.0.4)
              - Removing codeception/specify (0.4.6)
              - Removing codeception/phpunit-wrapper (6.0.10)
              - Removing codeception/base (2.4.1)
              - Removing bower-asset/typeahead.js (v0.11.1)
              - Removing behat/gherkin (v4.6.0)
              Generating autoload files



              There is also a maglnet/composer-require-checker which may be useful for detecting usage of libraries not listed in require section.






              share|improve this answer































                2
















                The easiest way to check which packages are dev-only is to run composer install (this will install all dependencies, including dev-only) and then composer install --no-dev (this will remove dev-only dependencies). Last command will give you list of removed dependencies - these are packages not available in production builds, you should not rely on them (or move them to require section in your composer.json).



                Example:



                $ composer install
                Loading composer repositories with package information
                Installing dependencies (including require-dev) from lock file
                Package operations: 56 installs, 0 updates, 0 removals
                - Installing yiisoft/yii2-composer (2.0.7): Loading from cache
                - Installing bower-asset/jquery (3.3.1): Loading from cache
                - Installing bower-asset/bootstrap (v3.4.1): Loading from cache
                - Installing bower-asset/inputmask (3.3.11): Loading from cache
                - Installing bower-asset/punycode (v1.3.2): Loading from cache
                - Installing bower-asset/yii2-pjax (2.0.7.1): Loading from cache
                - Installing cebe/markdown (1.2.1): Loading from cache
                - Installing ezyang/htmlpurifier (v4.10.0): Loading from cache
                - Installing yiisoft/yii2 (2.0.17): Loading from cache
                - Installing swiftmailer/swiftmailer (v5.4.12): Loading from cache
                - Installing yiisoft/yii2-swiftmailer (2.0.7): Loading from cache
                - Installing symfony/polyfill-ctype (v1.11.0): Loading from cache
                - Installing symfony/yaml (v2.8.49): Loading from cache
                - Installing symfony/finder (v2.8.49): Loading from cache
                - Installing symfony/event-dispatcher (v2.8.49): Loading from cache
                - Installing symfony/polyfill-mbstring (v1.11.0): Loading from cache
                - Installing symfony/dom-crawler (v2.8.49): Loading from cache
                - Installing symfony/css-selector (v2.8.49): Loading from cache
                - Installing psr/log (1.1.0): Loading from cache
                - Installing symfony/debug (v2.8.49): Loading from cache
                - Installing symfony/console (v2.8.49): Loading from cache
                - Installing symfony/browser-kit (v2.8.49): Loading from cache
                - Installing ralouphie/getallheaders (2.0.5): Loading from cache
                - Installing psr/http-message (1.0.1): Loading from cache
                - Installing guzzlehttp/psr7 (1.5.2): Loading from cache
                - Installing sebastian/recursion-context (1.0.5): Loading from cache
                - Installing sebastian/exporter (1.2.2): Loading from cache
                - Installing phpunit/php-text-template (1.2.1): Loading from cache
                - Installing doctrine/instantiator (1.0.5): Loading from cache
                - Installing phpunit/phpunit-mock-objects (2.3.8): Loading from cache
                - Installing codeception/stub (1.0.4): Loading from cache
                - Installing sebastian/diff (1.4.3): Loading from cache
                - Installing sebastian/comparator (1.2.4): Loading from cache
                - Installing sebastian/version (1.0.6): Loading from cache
                - Installing sebastian/global-state (1.1.1): Loading from cache
                - Installing sebastian/environment (1.3.8): Loading from cache
                - Installing phpunit/php-timer (1.0.9): Loading from cache
                - Installing phpunit/php-file-iterator (1.4.5): Loading from cache
                - Installing phpunit/php-token-stream (1.4.12): Loading from cache
                - Installing phpunit/php-code-coverage (2.2.4): Loading from cache
                - Installing phpdocumentor/reflection-docblock (2.0.5): Loading from cache
                - Installing phpspec/prophecy (1.8.0): Loading from cache
                - Installing phpunit/phpunit (4.8.36): Loading from cache
                - Installing codeception/phpunit-wrapper (6.0.10): Loading from cache
                - Installing behat/gherkin (v4.6.0): Loading from cache
                - Installing codeception/base (2.4.1): Loading from cache
                - Installing myclabs/deep-copy (1.6.1): Loading from cache
                - Installing codeception/specify (0.4.6): Loading from cache
                - Installing codeception/verify (0.3.3): Loading from cache
                - Installing yiisoft/yii2-bootstrap (2.0.9): Loading from cache
                - Installing yiisoft/yii2-debug (2.0.14): Loading from cache
                - Installing fzaninotto/faker (v1.8.0): Loading from cache
                - Installing yiisoft/yii2-faker (2.0.4): Loading from cache
                - Installing phpspec/php-diff (v1.1.0): Loading from cache
                - Installing bower-asset/typeahead.js (v0.11.1): Loading from cache
                - Installing yiisoft/yii2-gii (2.0.8): Loading from cache
                Generating autoload files


                And then list of dev-only dependencies:



                $ composer install --no-dev
                Loading composer repositories with package information
                Installing dependencies from lock file
                Package operations: 0 installs, 0 updates, 44 removals
                - Removing yiisoft/yii2-gii (2.0.8)
                - Removing yiisoft/yii2-faker (2.0.4)
                - Removing yiisoft/yii2-debug (2.0.14)
                - Removing symfony/yaml (v2.8.49)
                - Removing symfony/polyfill-mbstring (v1.11.0)
                - Removing symfony/polyfill-ctype (v1.11.0)
                - Removing symfony/finder (v2.8.49)
                - Removing symfony/event-dispatcher (v2.8.49)
                - Removing symfony/dom-crawler (v2.8.49)
                - Removing symfony/debug (v2.8.49)
                - Removing symfony/css-selector (v2.8.49)
                - Removing symfony/console (v2.8.49)
                - Removing symfony/browser-kit (v2.8.49)
                - Removing sebastian/version (1.0.6)
                - Removing sebastian/recursion-context (1.0.5)
                - Removing sebastian/global-state (1.1.1)
                - Removing sebastian/exporter (1.2.2)
                - Removing sebastian/environment (1.3.8)
                - Removing sebastian/diff (1.4.3)
                - Removing sebastian/comparator (1.2.4)
                - Removing ralouphie/getallheaders (2.0.5)
                - Removing psr/log (1.1.0)
                - Removing psr/http-message (1.0.1)
                - Removing phpunit/phpunit-mock-objects (2.3.8)
                - Removing phpunit/phpunit (4.8.36)
                - Removing phpunit/php-token-stream (1.4.12)
                - Removing phpunit/php-timer (1.0.9)
                - Removing phpunit/php-text-template (1.2.1)
                - Removing phpunit/php-file-iterator (1.4.5)
                - Removing phpunit/php-code-coverage (2.2.4)
                - Removing phpspec/prophecy (1.8.0)
                - Removing phpspec/php-diff (v1.1.0)
                - Removing phpdocumentor/reflection-docblock (2.0.5)
                - Removing myclabs/deep-copy (1.6.1)
                - Removing guzzlehttp/psr7 (1.5.2)
                - Removing fzaninotto/faker (v1.8.0)
                - Removing doctrine/instantiator (1.0.5)
                - Removing codeception/verify (0.3.3)
                - Removing codeception/stub (1.0.4)
                - Removing codeception/specify (0.4.6)
                - Removing codeception/phpunit-wrapper (6.0.10)
                - Removing codeception/base (2.4.1)
                - Removing bower-asset/typeahead.js (v0.11.1)
                - Removing behat/gherkin (v4.6.0)
                Generating autoload files



                There is also a maglnet/composer-require-checker which may be useful for detecting usage of libraries not listed in require section.






                share|improve this answer





























                  2














                  2










                  2









                  The easiest way to check which packages are dev-only is to run composer install (this will install all dependencies, including dev-only) and then composer install --no-dev (this will remove dev-only dependencies). Last command will give you list of removed dependencies - these are packages not available in production builds, you should not rely on them (or move them to require section in your composer.json).



                  Example:



                  $ composer install
                  Loading composer repositories with package information
                  Installing dependencies (including require-dev) from lock file
                  Package operations: 56 installs, 0 updates, 0 removals
                  - Installing yiisoft/yii2-composer (2.0.7): Loading from cache
                  - Installing bower-asset/jquery (3.3.1): Loading from cache
                  - Installing bower-asset/bootstrap (v3.4.1): Loading from cache
                  - Installing bower-asset/inputmask (3.3.11): Loading from cache
                  - Installing bower-asset/punycode (v1.3.2): Loading from cache
                  - Installing bower-asset/yii2-pjax (2.0.7.1): Loading from cache
                  - Installing cebe/markdown (1.2.1): Loading from cache
                  - Installing ezyang/htmlpurifier (v4.10.0): Loading from cache
                  - Installing yiisoft/yii2 (2.0.17): Loading from cache
                  - Installing swiftmailer/swiftmailer (v5.4.12): Loading from cache
                  - Installing yiisoft/yii2-swiftmailer (2.0.7): Loading from cache
                  - Installing symfony/polyfill-ctype (v1.11.0): Loading from cache
                  - Installing symfony/yaml (v2.8.49): Loading from cache
                  - Installing symfony/finder (v2.8.49): Loading from cache
                  - Installing symfony/event-dispatcher (v2.8.49): Loading from cache
                  - Installing symfony/polyfill-mbstring (v1.11.0): Loading from cache
                  - Installing symfony/dom-crawler (v2.8.49): Loading from cache
                  - Installing symfony/css-selector (v2.8.49): Loading from cache
                  - Installing psr/log (1.1.0): Loading from cache
                  - Installing symfony/debug (v2.8.49): Loading from cache
                  - Installing symfony/console (v2.8.49): Loading from cache
                  - Installing symfony/browser-kit (v2.8.49): Loading from cache
                  - Installing ralouphie/getallheaders (2.0.5): Loading from cache
                  - Installing psr/http-message (1.0.1): Loading from cache
                  - Installing guzzlehttp/psr7 (1.5.2): Loading from cache
                  - Installing sebastian/recursion-context (1.0.5): Loading from cache
                  - Installing sebastian/exporter (1.2.2): Loading from cache
                  - Installing phpunit/php-text-template (1.2.1): Loading from cache
                  - Installing doctrine/instantiator (1.0.5): Loading from cache
                  - Installing phpunit/phpunit-mock-objects (2.3.8): Loading from cache
                  - Installing codeception/stub (1.0.4): Loading from cache
                  - Installing sebastian/diff (1.4.3): Loading from cache
                  - Installing sebastian/comparator (1.2.4): Loading from cache
                  - Installing sebastian/version (1.0.6): Loading from cache
                  - Installing sebastian/global-state (1.1.1): Loading from cache
                  - Installing sebastian/environment (1.3.8): Loading from cache
                  - Installing phpunit/php-timer (1.0.9): Loading from cache
                  - Installing phpunit/php-file-iterator (1.4.5): Loading from cache
                  - Installing phpunit/php-token-stream (1.4.12): Loading from cache
                  - Installing phpunit/php-code-coverage (2.2.4): Loading from cache
                  - Installing phpdocumentor/reflection-docblock (2.0.5): Loading from cache
                  - Installing phpspec/prophecy (1.8.0): Loading from cache
                  - Installing phpunit/phpunit (4.8.36): Loading from cache
                  - Installing codeception/phpunit-wrapper (6.0.10): Loading from cache
                  - Installing behat/gherkin (v4.6.0): Loading from cache
                  - Installing codeception/base (2.4.1): Loading from cache
                  - Installing myclabs/deep-copy (1.6.1): Loading from cache
                  - Installing codeception/specify (0.4.6): Loading from cache
                  - Installing codeception/verify (0.3.3): Loading from cache
                  - Installing yiisoft/yii2-bootstrap (2.0.9): Loading from cache
                  - Installing yiisoft/yii2-debug (2.0.14): Loading from cache
                  - Installing fzaninotto/faker (v1.8.0): Loading from cache
                  - Installing yiisoft/yii2-faker (2.0.4): Loading from cache
                  - Installing phpspec/php-diff (v1.1.0): Loading from cache
                  - Installing bower-asset/typeahead.js (v0.11.1): Loading from cache
                  - Installing yiisoft/yii2-gii (2.0.8): Loading from cache
                  Generating autoload files


                  And then list of dev-only dependencies:



                  $ composer install --no-dev
                  Loading composer repositories with package information
                  Installing dependencies from lock file
                  Package operations: 0 installs, 0 updates, 44 removals
                  - Removing yiisoft/yii2-gii (2.0.8)
                  - Removing yiisoft/yii2-faker (2.0.4)
                  - Removing yiisoft/yii2-debug (2.0.14)
                  - Removing symfony/yaml (v2.8.49)
                  - Removing symfony/polyfill-mbstring (v1.11.0)
                  - Removing symfony/polyfill-ctype (v1.11.0)
                  - Removing symfony/finder (v2.8.49)
                  - Removing symfony/event-dispatcher (v2.8.49)
                  - Removing symfony/dom-crawler (v2.8.49)
                  - Removing symfony/debug (v2.8.49)
                  - Removing symfony/css-selector (v2.8.49)
                  - Removing symfony/console (v2.8.49)
                  - Removing symfony/browser-kit (v2.8.49)
                  - Removing sebastian/version (1.0.6)
                  - Removing sebastian/recursion-context (1.0.5)
                  - Removing sebastian/global-state (1.1.1)
                  - Removing sebastian/exporter (1.2.2)
                  - Removing sebastian/environment (1.3.8)
                  - Removing sebastian/diff (1.4.3)
                  - Removing sebastian/comparator (1.2.4)
                  - Removing ralouphie/getallheaders (2.0.5)
                  - Removing psr/log (1.1.0)
                  - Removing psr/http-message (1.0.1)
                  - Removing phpunit/phpunit-mock-objects (2.3.8)
                  - Removing phpunit/phpunit (4.8.36)
                  - Removing phpunit/php-token-stream (1.4.12)
                  - Removing phpunit/php-timer (1.0.9)
                  - Removing phpunit/php-text-template (1.2.1)
                  - Removing phpunit/php-file-iterator (1.4.5)
                  - Removing phpunit/php-code-coverage (2.2.4)
                  - Removing phpspec/prophecy (1.8.0)
                  - Removing phpspec/php-diff (v1.1.0)
                  - Removing phpdocumentor/reflection-docblock (2.0.5)
                  - Removing myclabs/deep-copy (1.6.1)
                  - Removing guzzlehttp/psr7 (1.5.2)
                  - Removing fzaninotto/faker (v1.8.0)
                  - Removing doctrine/instantiator (1.0.5)
                  - Removing codeception/verify (0.3.3)
                  - Removing codeception/stub (1.0.4)
                  - Removing codeception/specify (0.4.6)
                  - Removing codeception/phpunit-wrapper (6.0.10)
                  - Removing codeception/base (2.4.1)
                  - Removing bower-asset/typeahead.js (v0.11.1)
                  - Removing behat/gherkin (v4.6.0)
                  Generating autoload files



                  There is also a maglnet/composer-require-checker which may be useful for detecting usage of libraries not listed in require section.






                  share|improve this answer















                  The easiest way to check which packages are dev-only is to run composer install (this will install all dependencies, including dev-only) and then composer install --no-dev (this will remove dev-only dependencies). Last command will give you list of removed dependencies - these are packages not available in production builds, you should not rely on them (or move them to require section in your composer.json).



                  Example:



                  $ composer install
                  Loading composer repositories with package information
                  Installing dependencies (including require-dev) from lock file
                  Package operations: 56 installs, 0 updates, 0 removals
                  - Installing yiisoft/yii2-composer (2.0.7): Loading from cache
                  - Installing bower-asset/jquery (3.3.1): Loading from cache
                  - Installing bower-asset/bootstrap (v3.4.1): Loading from cache
                  - Installing bower-asset/inputmask (3.3.11): Loading from cache
                  - Installing bower-asset/punycode (v1.3.2): Loading from cache
                  - Installing bower-asset/yii2-pjax (2.0.7.1): Loading from cache
                  - Installing cebe/markdown (1.2.1): Loading from cache
                  - Installing ezyang/htmlpurifier (v4.10.0): Loading from cache
                  - Installing yiisoft/yii2 (2.0.17): Loading from cache
                  - Installing swiftmailer/swiftmailer (v5.4.12): Loading from cache
                  - Installing yiisoft/yii2-swiftmailer (2.0.7): Loading from cache
                  - Installing symfony/polyfill-ctype (v1.11.0): Loading from cache
                  - Installing symfony/yaml (v2.8.49): Loading from cache
                  - Installing symfony/finder (v2.8.49): Loading from cache
                  - Installing symfony/event-dispatcher (v2.8.49): Loading from cache
                  - Installing symfony/polyfill-mbstring (v1.11.0): Loading from cache
                  - Installing symfony/dom-crawler (v2.8.49): Loading from cache
                  - Installing symfony/css-selector (v2.8.49): Loading from cache
                  - Installing psr/log (1.1.0): Loading from cache
                  - Installing symfony/debug (v2.8.49): Loading from cache
                  - Installing symfony/console (v2.8.49): Loading from cache
                  - Installing symfony/browser-kit (v2.8.49): Loading from cache
                  - Installing ralouphie/getallheaders (2.0.5): Loading from cache
                  - Installing psr/http-message (1.0.1): Loading from cache
                  - Installing guzzlehttp/psr7 (1.5.2): Loading from cache
                  - Installing sebastian/recursion-context (1.0.5): Loading from cache
                  - Installing sebastian/exporter (1.2.2): Loading from cache
                  - Installing phpunit/php-text-template (1.2.1): Loading from cache
                  - Installing doctrine/instantiator (1.0.5): Loading from cache
                  - Installing phpunit/phpunit-mock-objects (2.3.8): Loading from cache
                  - Installing codeception/stub (1.0.4): Loading from cache
                  - Installing sebastian/diff (1.4.3): Loading from cache
                  - Installing sebastian/comparator (1.2.4): Loading from cache
                  - Installing sebastian/version (1.0.6): Loading from cache
                  - Installing sebastian/global-state (1.1.1): Loading from cache
                  - Installing sebastian/environment (1.3.8): Loading from cache
                  - Installing phpunit/php-timer (1.0.9): Loading from cache
                  - Installing phpunit/php-file-iterator (1.4.5): Loading from cache
                  - Installing phpunit/php-token-stream (1.4.12): Loading from cache
                  - Installing phpunit/php-code-coverage (2.2.4): Loading from cache
                  - Installing phpdocumentor/reflection-docblock (2.0.5): Loading from cache
                  - Installing phpspec/prophecy (1.8.0): Loading from cache
                  - Installing phpunit/phpunit (4.8.36): Loading from cache
                  - Installing codeception/phpunit-wrapper (6.0.10): Loading from cache
                  - Installing behat/gherkin (v4.6.0): Loading from cache
                  - Installing codeception/base (2.4.1): Loading from cache
                  - Installing myclabs/deep-copy (1.6.1): Loading from cache
                  - Installing codeception/specify (0.4.6): Loading from cache
                  - Installing codeception/verify (0.3.3): Loading from cache
                  - Installing yiisoft/yii2-bootstrap (2.0.9): Loading from cache
                  - Installing yiisoft/yii2-debug (2.0.14): Loading from cache
                  - Installing fzaninotto/faker (v1.8.0): Loading from cache
                  - Installing yiisoft/yii2-faker (2.0.4): Loading from cache
                  - Installing phpspec/php-diff (v1.1.0): Loading from cache
                  - Installing bower-asset/typeahead.js (v0.11.1): Loading from cache
                  - Installing yiisoft/yii2-gii (2.0.8): Loading from cache
                  Generating autoload files


                  And then list of dev-only dependencies:



                  $ composer install --no-dev
                  Loading composer repositories with package information
                  Installing dependencies from lock file
                  Package operations: 0 installs, 0 updates, 44 removals
                  - Removing yiisoft/yii2-gii (2.0.8)
                  - Removing yiisoft/yii2-faker (2.0.4)
                  - Removing yiisoft/yii2-debug (2.0.14)
                  - Removing symfony/yaml (v2.8.49)
                  - Removing symfony/polyfill-mbstring (v1.11.0)
                  - Removing symfony/polyfill-ctype (v1.11.0)
                  - Removing symfony/finder (v2.8.49)
                  - Removing symfony/event-dispatcher (v2.8.49)
                  - Removing symfony/dom-crawler (v2.8.49)
                  - Removing symfony/debug (v2.8.49)
                  - Removing symfony/css-selector (v2.8.49)
                  - Removing symfony/console (v2.8.49)
                  - Removing symfony/browser-kit (v2.8.49)
                  - Removing sebastian/version (1.0.6)
                  - Removing sebastian/recursion-context (1.0.5)
                  - Removing sebastian/global-state (1.1.1)
                  - Removing sebastian/exporter (1.2.2)
                  - Removing sebastian/environment (1.3.8)
                  - Removing sebastian/diff (1.4.3)
                  - Removing sebastian/comparator (1.2.4)
                  - Removing ralouphie/getallheaders (2.0.5)
                  - Removing psr/log (1.1.0)
                  - Removing psr/http-message (1.0.1)
                  - Removing phpunit/phpunit-mock-objects (2.3.8)
                  - Removing phpunit/phpunit (4.8.36)
                  - Removing phpunit/php-token-stream (1.4.12)
                  - Removing phpunit/php-timer (1.0.9)
                  - Removing phpunit/php-text-template (1.2.1)
                  - Removing phpunit/php-file-iterator (1.4.5)
                  - Removing phpunit/php-code-coverage (2.2.4)
                  - Removing phpspec/prophecy (1.8.0)
                  - Removing phpspec/php-diff (v1.1.0)
                  - Removing phpdocumentor/reflection-docblock (2.0.5)
                  - Removing myclabs/deep-copy (1.6.1)
                  - Removing guzzlehttp/psr7 (1.5.2)
                  - Removing fzaninotto/faker (v1.8.0)
                  - Removing doctrine/instantiator (1.0.5)
                  - Removing codeception/verify (0.3.3)
                  - Removing codeception/stub (1.0.4)
                  - Removing codeception/specify (0.4.6)
                  - Removing codeception/phpunit-wrapper (6.0.10)
                  - Removing codeception/base (2.4.1)
                  - Removing bower-asset/typeahead.js (v0.11.1)
                  - Removing behat/gherkin (v4.6.0)
                  Generating autoload files



                  There is also a maglnet/composer-require-checker which may be useful for detecting usage of libraries not listed in require section.







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Apr 1 at 17:29

























                  answered Mar 30 at 11:50









                  rob006rob006

                  13k4 gold badges20 silver badges40 bronze badges




                  13k4 gold badges20 silver badges40 bronze badges


























                      1
















                      Basically, any package (and its dependencies) in require-dev section of your composer.json file will not be autoloaded when you use composer dump-autoload --no-dev. Sadly, I don't think there's a command to show those packages together with their dependencies as a single list.



                      What you can do is try moving each of the packages from require-dev section to require, reruning composer update and composer dump-autoload --no-dev to see when your error disappears.






                      share|improve this answer





























                        1
















                        Basically, any package (and its dependencies) in require-dev section of your composer.json file will not be autoloaded when you use composer dump-autoload --no-dev. Sadly, I don't think there's a command to show those packages together with their dependencies as a single list.



                        What you can do is try moving each of the packages from require-dev section to require, reruning composer update and composer dump-autoload --no-dev to see when your error disappears.






                        share|improve this answer



























                          1














                          1










                          1









                          Basically, any package (and its dependencies) in require-dev section of your composer.json file will not be autoloaded when you use composer dump-autoload --no-dev. Sadly, I don't think there's a command to show those packages together with their dependencies as a single list.



                          What you can do is try moving each of the packages from require-dev section to require, reruning composer update and composer dump-autoload --no-dev to see when your error disappears.






                          share|improve this answer













                          Basically, any package (and its dependencies) in require-dev section of your composer.json file will not be autoloaded when you use composer dump-autoload --no-dev. Sadly, I don't think there's a command to show those packages together with their dependencies as a single list.



                          What you can do is try moving each of the packages from require-dev section to require, reruning composer update and composer dump-autoload --no-dev to see when your error disappears.







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered Mar 30 at 9:15









                          Edi ModrićEdi Modrić

                          1,4738 silver badges13 bronze badges




                          1,4738 silver badges13 bronze badges































                              draft saved

                              draft discarded















































                              Thanks for contributing an answer to Stack Overflow!


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid


                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.

                              To learn more, see our tips on writing great answers.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function ()
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55406710%2fcomposer-show-dev-packages-and-non-dev-packages%23new-answer', 'question_page');

                              );

                              Post as a guest















                              Required, but never shown





















































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown

































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown







                              Popular posts from this blog

                              Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

                              Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

                              Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript