Skip to content

composer install -devCOMPOSER_NO_DEV=0 composer install#9172

Open
Geremia wants to merge 1 commit intoSimpleMachines:release-3.0from
Geremia:release-3.0
Open

composer install -devCOMPOSER_NO_DEV=0 composer install#9172
Geremia wants to merge 1 commit intoSimpleMachines:release-3.0from
Geremia:release-3.0

Conversation

@Geremia
Copy link
Copy Markdown

@Geremia Geremia commented Mar 27, 2026

No description provided.

@Geremia
Copy link
Copy Markdown
Author

Geremia commented Mar 27, 2026

Actually, this is valid for Composer 2.9.5, but in ≥3, it's deprecated:

You are using the deprecated option "--dev". It has no effect and will break in Composer 3.

@live627
Copy link
Copy Markdown
Contributor

live627 commented Mar 27, 2026

from https://stackoverflow.com/a/73351476

You can set the environment variable COMPOSER_NO_DEV to 0 or 1 to change the default behaviour of composer install and composer update.

see: documentation - COMPOSER_NO_DEV

  • If you want composer install to not install the dev dependencies by default
    • export COMPOSER_NO_DEV=1
  • If you want composer install to install dev dependencies (the default)
    • export COMPOSER_NO_DEV=0
    • or unset COMPOSER_NO_DEV

Depending on how you develop (i.e. in a container) there are various options to set a default value for the environment variable.

On the other hand you can instruct your engineer colleagues that do not require any dev dependencies to run the command:

composer install --no-dev

# .. or ..
COMPOSER_NO_DEV=1 composer install

... instead of ...

composer install

# .. or ..
COMPOSER_NO_DEV=0 composer install

@Geremia
Copy link
Copy Markdown
Author

Geremia commented Mar 27, 2026

@live627 Thanks. I've changed to COMPOSER_NO_DEV=0 to instead.

@Geremia Geremia force-pushed the release-3.0 branch 2 times, most recently from 401a749 to ccc3a4f Compare March 27, 2026 17:59
@Geremia Geremia changed the title -dev (in composer install -dev) needs to be --dev composer install -devCOMPOSER_NO_DEV=0 composer install Mar 27, 2026
@jdarwood007
Copy link
Copy Markdown
Member

So the default composer run is to include developer dependencies now?
Seems a bit backwards.

@live627
Copy link
Copy Markdown
Contributor

live627 commented Apr 4, 2026 via email

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

Successfully merging this pull request may close these issues.

3 participants