6

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

Did you mean one of these?

  setup
  setup:config
  setup:cron
  setup:db-data
  setup:db-schema
  setup:db
  setup:di
  setup:performance
  setup:store-config

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

2
  • 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. Dec 20, 2016 at 7:44
  • if you have space at start code than remove it and than execute commad
    – Waseem
    Nov 21, 2019 at 12:53

8 Answers 8

9

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/* var/cache/* var/report/*  var/page_cache/* pub/static/* var/view_preprocessed/*
1
  • Source error, I setup again then deploy ok. Thanks you. Dec 29, 2016 at 3:40
4

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.

3

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.

0
1

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

0

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

0

Use below command

php bin/magento setup:static-content:deploy

php bin/magento cache:flush

chomd -R 777 var/ pub/ generated/

0

You can follow this way for soliving the issue

First Give Permissions

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

chomd -R 777 var/ pub/ generated/

bin/magento setup:static-content:deploy -f

Thank You

0

As Far As I know, this issue may occur due to below issues.

  1. Mysql Not Running
  2. Improper File Permissions

Steps can be taken up like below.

systemctl restart mysql

find . -type f -exec chmod 644 {} +;
find . -type d -exec chmod 755 {} +;
find var/ pub/static pub/media app/etc generated/ -type f -exec chmod g+w {} +;
find var/ pub/static pub/media app/etc generated/ -type d -exec chmod g+ws {} +;
chmod 640 app/etc/env.php;
chmod -R g+s .;

rm -rf ./generated/**/*

php bin/magento c:f
php bin/magento deploy:mode:set developer

Your Answer

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

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