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
-
In terminal other command work like cache clear and indexing ?Feedlay Technologies– Feedlay Technologies2018年08月09日 05:06:57 +00:00Commented Aug 9, 2018 at 5:06
7 Answers 7
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.
Try by enabling developer mode
php bin/magento deploy:mode:set developer
Run Following steps to check & then try again:
- Run "composer install" in magento root
- please use the -v or -vv option in the command line for debug information.
- If an extension has no
etc/module.xmlfile thenbin/magentofails. - If a
composer.jsonhas a syntax error.
I hope it helps!
First, remove generated directory and execute
php bin/magento setup:di:compile
provide permission 777 to generated directory.
now please check your Magento commands
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.
Just flush your redis cache. This is the problem.
redis-cli FLUSHALL
It might be a permission issue. You can run these commands under your Magento directory :
sudo chmod 775 -R ./generated/ ./var/ ./pub/
-
It did not. I got this error: [Symfony\Component\Console\Exception\CommandNotFoundException] There are no commands defined in the "deploy:mode" namespace.Matthew McLennan– Matthew McLennan2018年08月08日 19:12:21 +00:00Commented Aug 8, 2018 at 19:12
-
@MatthewMcLennan i updated my answer , you can check itsami23– sami232018年08月08日 19:32:26 +00:00Commented Aug 8, 2018 at 19:32
-
1Never give permission like above,because it should be like sudo chmod 777 -R var/Jaisa– Jaisa2018年12月14日 07:25:35 +00:00Commented Dec 14, 2018 at 7:25
-
Please put slash after var. don't use it beforeJaisa– Jaisa2018年12月14日 07:26:17 +00:00Commented Dec 14, 2018 at 7:26