There are no commands defined in the "setup:static-content" namespace.

Did you mean one of these?


When Run deploy Command in Magento 2 show error in console?

  • Please don't just dump error messages in the question form. You should at least explain when it happens and if you did any changes before. Otherwise you will get mostly random useless answers. – Fabian Schmengler Dec 20 '16 at 7:44
  • if you have space at start code than remove it and than execute commad – Waseem Nov 21 '19 at 12:53

first run the cmd composer install in you folder then run this cmd

php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy (or) 
php bin/magento setup:static-content:deploy -f
php bin/magento indexer:reindex
php bin/magento cache:flush (or)
php bin/magento cache:clean

after setup:upgrade you remove the generation, page_cache, cache, view_preprocessed, static rm -rf var/generation/*

| improve this answer | |
  • Source error, I setup again then deploy ok. Thanks you. – TUYEN TRAN THANH Dec 29 '16 at 3:40

You have to call below command in your cmd,

php bin/magento setup:static-content:deploy

After run above command no error are display.

Remove var folder and clear cache.

| improve this answer | |

Run below command

php bin/magento setup:upgrade

So above command will show error and according to that you can resolve error.

Another option you can check error log in var/log folder.

Generally this error comes when we did some mistake in any module.xml file. So try to check for modules's module.xml file as well.

| improve this answer | |

You may also need to file permission if you run through Linux based system. i have same issue and resolved by setting up file permission properly. http://devdocs.magento.com/guides/v2.0/install-gde/prereq/file-system-perms.html

| improve this answer | |

This is perfect working example ,

Just execute the below command from the SSH,

find . -type d -exec chmod 755 {} \; && find . -type f -exec chmod 644 {} \; && chmod u+x bin/magento

| improve this answer | |

Use below command

php bin/magento setup:static-content:deploy

php bin/magento cache:flush

chomd -R 777 var/ pub/ generated/

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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