4

I need to set the application mode to developer, but when I tried doing so I got the exception

[InvalidArgumentException]
There are no commands defined in the "deploy:mode" namespace.

Running bin/magento list, I notice that many of the commands that I need to use, including all deploy: commands do not show.

What can be the cause of this?

I am using Magento CE 2.1.3.

6
  • try with, php bin/magento deploy:mode:set developer Commented Jan 17, 2017 at 10:13
  • Wow, I thought I already tried that. This solved my problem. Commented Jan 17, 2017 at 10:31
  • above command is working for you? Commented Jan 17, 2017 at 10:34
  • Use php bin/magento instead of bin/magento
    – BornCoder
    Commented Jan 17, 2017 at 10:50
  • Yes, the above command works. Thank you @Rakesh Commented Jan 18, 2017 at 15:32

8 Answers 8

-3

You have to run command

php bin/magento deploy:mode:set developer
11

In my case I was setting up a new server and had copied the database over from a development site. Although I had an app/etc/env.php file and it was pointing at the correct db, it was missing the install/date timestamp config so Magento didn't know that the application had been installed and wasn't showing all the commands. Thanks to yaronishs answer I was able to figure this out, simply adding a timestamp to app/etc/env.php got all the expected commands running.

1
  • In my case it was missing install entry with timestamp in app/etc/env.php. After adding install all commands were added Commented Mar 9, 2020 at 13:19
9

Some commands became available only after installation. The mentioned exception appears once you try to run such commands before installation.

Probably you missed installing Magento.

3

I was unable to execute the command bin/magento deploy:mode:set developer. so after research i had found that install date is missing in env.php file.

I added below element in env.php,

'install' => [ 'date' => 'Thu, 01 Feb 2021 05:48:29 +0000' ]

1

I Was facing the same issue (Magento CE 2.4.3-p2)

Re-executing php bin/magento setup:install Command fixed this issue.

php bin/magento setup:install --base-url="http://127.0.0.1/projects/m243/" --db-host="localhost" --db-name="magento_243" --db-user="root" --db-password="" --admin-firstname="Admin" --admin-lastname="User" --admin-email="[email protected]" --admin-user="admin" --admin-password="admin123" --language="en_US" --currency="USD" --timezone="America/Chicago" --use-rewrites="1" --backend-frontname="admin" --elasticsearch-host=127.0.0.1 --elasticsearch-port=9200 --search-engine=elasticsearch7 
0

I was facing same issue,

[InvalidArgumentException] There are no commands defined in the "deploy:mode" namespace.

then I check for env.php inside app/etc folder, it is was missing, after adding env.php inside app/etc folder command is running properly

0

I had this problem, but the solution was different, so I thought I'd log that here.

The problem was that I'd uploaded an invalid module (it was lacking a module.xml file).

Whilst running most commands returned "There are no commands defined in the "deploy:mode" namespace.", if I ran the command php bin/magento then it returned a more useful error message, which allowed me to find the fix.

0

I had the same issue, there was a permission issue.

please execute the permission command for var, generated (chmod command), and also check the file's owner (chown command)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.