Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Composer install loads require-dev when I require another package #4477

Closed
julesbl opened this issue Mar 23, 2021 · 2 comments
Closed

Comments

@julesbl
Copy link

julesbl commented Mar 23, 2021

Direction
We use github issues to track bugs, not for support.
If you have a support question, or a feature request, raise these as threads on our
forum.

Describe the bug
Installing a basic start project using composer using the following
composer create-project codeigniter4/appstarter Automator_working --no-dev

Get the following

==========================================================
Creating a "codeigniter4/appstarter" project at "./Automator_working"
Installing codeigniter4/appstarter (v4.1.1)

  • Installing codeigniter4/appstarter (v4.1.1): Extracting archive
    Created project in /home/julianb/WebSites/TwwYachts/Automator_working
    Loading composer repositories with package information
    Updating dependencies
    Lock file operations: 41 installs, 0 updates, 0 removals
  • Locking codeigniter4/framework (v4.1.1)
  • Locking doctrine/instantiator (1.4.0)
  • Locking fakerphp/faker (v1.13.0)
  • Locking kint-php/kint (3.3)
  • Locking laminas/laminas-escaper (2.7.0)
  • Locking laminas/laminas-zendframework-bridge (1.2.0)
  • Locking mikey179/vfsstream (v1.6.8)
  • Locking myclabs/deep-copy (1.10.2)
  • Locking nikic/php-parser (v4.10.4)
  • Locking phar-io/manifest (2.0.1)
  • Locking phar-io/version (3.1.0)
  • Locking phpdocumentor/reflection-common (2.2.0)
  • Locking phpdocumentor/reflection-docblock (5.2.2)
  • Locking phpdocumentor/type-resolver (1.4.0)
  • Locking phpspec/prophecy (1.13.0)
  • Locking phpunit/php-code-coverage (9.2.5)
  • Locking phpunit/php-file-iterator (3.0.5)
  • Locking phpunit/php-invoker (3.1.1)
  • Locking phpunit/php-text-template (2.0.4)
  • Locking phpunit/php-timer (5.0.3)
  • Locking phpunit/phpunit (9.5.4)
  • Locking psr/log (1.1.3)
  • Locking sebastian/cli-parser (1.0.1)
  • Locking sebastian/code-unit (1.0.8)
  • Locking sebastian/code-unit-reverse-lookup (2.0.3)
  • Locking sebastian/comparator (4.0.6)
  • Locking sebastian/complexity (2.0.2)
  • Locking sebastian/diff (4.0.4)
  • Locking sebastian/environment (5.1.3)
  • Locking sebastian/exporter (4.0.3)
  • Locking sebastian/global-state (5.0.2)
  • Locking sebastian/lines-of-code (1.0.3)
  • Locking sebastian/object-enumerator (4.0.4)
  • Locking sebastian/object-reflector (2.0.4)
  • Locking sebastian/recursion-context (4.0.4)
  • Locking sebastian/resource-operations (3.0.3)
  • Locking sebastian/type (2.3.1)
  • Locking sebastian/version (3.0.2)
  • Locking symfony/polyfill-ctype (v1.22.1)
  • Locking theseer/tokenizer (1.2.0)
  • Locking webmozart/assert (1.10.0)
    Writing lock file
    Installing dependencies from lock file
    Package operations: 5 installs, 0 updates, 0 removals
  • Installing psr/log (1.1.3): Extracting archive
  • Installing laminas/laminas-zendframework-bridge (1.2.0): Extracting archive
  • Installing laminas/laminas-escaper (2.7.0): Extracting archive
  • Installing kint-php/kint (3.3): Extracting archive
  • Installing codeigniter4/framework (v4.1.1): Extracting archive
    10 package suggestions were added by new dependencies, use composer suggest to see details.
    Generating autoload files
    2 packages you are using are looking for funding.
    Use the composer fund command to find out more!
    ================================================================

So installs codigniter correctly.

cd Automator_working/

Add twig
composer require twig/twig

I get this

================================================
Using version ^3.3 for twig/twig
./composer.json has been updated
Running composer update twig/twig
Loading composer repositories with package information
Updating dependencies
Lock file operations: 2 installs, 0 updates, 0 removals

  • Locking symfony/polyfill-mbstring (v1.22.1)
  • Locking twig/twig (v3.3.0)
    Writing lock file
    Installing dependencies from lock file (including require-dev)
    Package operations: 38 installs, 0 updates, 0 removals
  • Downloading symfony/polyfill-mbstring (v1.22.1)
  • Downloading twig/twig (v3.3.0)
  • Installing fakerphp/faker (v1.13.0): Extracting archive
  • Installing mikey179/vfsstream (v1.6.8): Extracting archive
  • Installing symfony/polyfill-ctype (v1.22.1): Extracting archive
  • Installing webmozart/assert (1.10.0): Extracting archive
  • Installing phpdocumentor/reflection-common (2.2.0): Extracting archive
  • Installing phpdocumentor/type-resolver (1.4.0): Extracting archive
  • Installing phpdocumentor/reflection-docblock (5.2.2): Extracting archive
  • Installing sebastian/version (3.0.2): Extracting archive
  • Installing sebastian/type (2.3.1): Extracting archive
  • Installing sebastian/resource-operations (3.0.3): Extracting archive
  • Installing sebastian/recursion-context (4.0.4): Extracting archive
  • Installing sebastian/object-reflector (2.0.4): Extracting archive
  • Installing sebastian/object-enumerator (4.0.4): Extracting archive
  • Installing sebastian/global-state (5.0.2): Extracting archive
  • Installing sebastian/exporter (4.0.3): Extracting archive
  • Installing sebastian/environment (5.1.3): Extracting archive
  • Installing sebastian/diff (4.0.4): Extracting archive
  • Installing sebastian/comparator (4.0.6): Extracting archive
  • Installing sebastian/code-unit (1.0.8): Extracting archive
  • Installing sebastian/cli-parser (1.0.1): Extracting archive
  • Installing phpunit/php-timer (5.0.3): Extracting archive
  • Installing phpunit/php-text-template (2.0.4): Extracting archive
  • Installing phpunit/php-invoker (3.1.1): Extracting archive
  • Installing phpunit/php-file-iterator (3.0.5): Extracting archive
  • Installing theseer/tokenizer (1.2.0): Extracting archive
  • Installing nikic/php-parser (v4.10.4): Extracting archive
  • Installing sebastian/lines-of-code (1.0.3): Extracting archive
  • Installing sebastian/complexity (2.0.2): Extracting archive
  • Installing sebastian/code-unit-reverse-lookup (2.0.3): Extracting archive
  • Installing phpunit/php-code-coverage (9.2.5): Extracting archive
  • Installing doctrine/instantiator (1.4.0): Extracting archive
  • Installing phpspec/prophecy (1.13.0): Extracting archive
  • Installing phar-io/version (3.1.0): Extracting archive
  • Installing phar-io/manifest (2.0.1): Extracting archive
  • Installing myclabs/deep-copy (1.10.2): Extracting archive
  • Installing phpunit/phpunit (9.5.4): Extracting archive
  • Installing symfony/polyfill-mbstring (v1.22.1): Extracting archive
  • Installing twig/twig (v3.3.0): Extracting archive
    Generating autoload files
    30 packages you are using are looking for funding.
    Use the composer fund command to find out more!
    =================================================================

As you can see it installs twig fine and then it installs all the development parts of codeigniter.
I have not been able to stop it doing this, seems a bit odd that it installs the development version by default anyway.

CodeIgniter 4 version
4.1.1

Affected module(s)
The composer configuration

Expected behavior, and steps to reproduce if appropriate
I expected it to install the non dev version of composer and then allow me to install other apps as needed.

Context

  • OS: LinuxMint
  • Web server NA
  • PHP version 7.3.27
@julesbl julesbl added the bug Verified issues on the current code behavior or pull requests that will fix them label Mar 23, 2021
@paulbalandan
Copy link
Member

This has nothing to do with codeigniter. This is a composer behavior. If you do not want to install dev dependencies, use the --no-dev flag when usingcomposer require

@paulbalandan paulbalandan removed the bug Verified issues on the current code behavior or pull requests that will fix them label Mar 23, 2021
@julesbl
Copy link
Author

julesbl commented Mar 23, 2021

So basically we have to add the --update-no-dev to all require from now on to prevent the loading of the codeigniter dev version?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants