codeigniter4 / CodeIgniter4

Open Source PHP Framework (originally from EllisLab)
https://codeigniter.com/
MIT License
5.3k stars 1.89k forks source link

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

Closed julesbl closed 3 years ago

julesbl commented 3 years ago

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)

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

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

paulbalandan commented 3 years ago

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

julesbl commented 3 years ago

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?