3

Whenever I run the common commands I get this and similarly named errors:

 [Symfony\Component\Console\Exception\CommandNotFoundException] 
 There are no commands defined in the "deploy:mode" namespace.

Im using Magento 2.2.5

asked Aug 8, 2018 at 19:08
1
  • In terminal other command work like cache clear and indexing ? Commented Aug 9, 2018 at 5:06

7 Answers 7

1

For me, the resolution was to compile: bin/magento setup:di:compile. If that seems to do nothing or acts like it completes part of the way through, try increasing your memory limit: php -dmemory_limit=5G bin/magento setup:di:compile. Once I had compiled, I could set the deploy mode.

answered Nov 30, 2020 at 18:06
0

Try by enabling developer mode

php bin/magento deploy:mode:set developer

answered Feb 19, 2019 at 4:44
0

Run Following steps to check & then try again:

  1. Run "composer install" in magento root
  2. please use the -v or -vv option in the command line for debug information.
  3. If an extension has no etc/module.xml file then bin/magento fails.
  4. If a composer.json has a syntax error.

I hope it helps!

answered Feb 19, 2019 at 4:58
0

First, remove generated directory and execute

php bin/magento setup:di:compile

provide permission 777 to generated directory.

now please check your Magento commands

answered Aug 31, 2021 at 14:14
0

Not having a proper content in app/etc/env.php / missing the default db connection array node can also cause the deploy:mode command to be missing from bin/magento, along with many other commands. Check that you have a properly defined .env file, comparing to .env.dist. The behaviour of missing commands, can be replicated quickly (at least on Magento 2.3.6) by emptying .env file as such

<?php
 return [
];

or removing just the default node from the db/connection node

'db' => [
 'table_prefix' => '',
 'connection' => [
 'default' => [

in the .env file.

answered Oct 30, 2021 at 23:17
0

Just flush your redis cache. This is the problem.

redis-cli FLUSHALL
answered Oct 14, 2022 at 9:33
-2

It might be a permission issue. You can run these commands under your Magento directory :

sudo chmod 775 -R ./generated/ ./var/ ./pub/

Rafael Corrêa Gomes
13.9k15 gold badges92 silver badges190 bronze badges
answered Aug 8, 2018 at 19:10
4
  • It did not. I got this error: [Symfony\Component\Console\Exception\CommandNotFoundException] There are no commands defined in the "deploy:mode" namespace. Commented Aug 8, 2018 at 19:12
  • @MatthewMcLennan i updated my answer , you can check it Commented Aug 8, 2018 at 19:32
  • 1
    Never give permission like above,because it should be like sudo chmod 777 -R var/ Commented Dec 14, 2018 at 7:25
  • Please put slash after var. don't use it before Commented Dec 14, 2018 at 7:26

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.