I have a magento2 site . When i try to install a new extension, pub/static folder get empty.
Due to which all js and css stop working. Can anyone suggest me the solution for this problem.
Please run below command in magento 2 root directory to generate content
php bin/magento cache:clean php bin/magento cache:flush php bin/magento setup:upgrade rm -rf pub/static/frontend/* pub/static/adminhtml/* var/cache/ var/generation/ var/page_cache/ var/view_preprocessed/ var/composer_home generated/ php -dmemory_limit=6G bin/magento setup:static-content:deploy -f chmod -Rf 777 pub/ var/ php bin/magento cache:clean
If my answer is useful, please Accept as Solution & give Kudos
Please follow below steps:
chmod -R 777 pub/ var/ && rm -rf var/view_preprocessed/ var/cache/ var/page_cache/ var/tmp/php bin/magento cache:flush &php bin/magento setup:upgrade &&php bin/magento setup:static-content:deploy chmod -R 777 pub/ var/ generated/
then you can find CSS and JS in working mode.
But after run suggested commands , it shows nothings to import and pub/static folder get empty.
And front-end shows below errors
Thanks for your reply .
I am new to magento
can you please suggest what i have to do line by line and explain what will it do ?
Do you have an idea about CLI, you have to run all shared commands using CLI.
Go to Magento root directory in CLI and run all shared commands in sequence.
Try below steps in sequence , it will resolved your problem !
Remove pub/static [Keep the .htaccess backed up and copy it again] Remove var/cache Remove var/composer_home Remove var/generation Remove Generated Remove var/page_cache Remove var/view_preprocessed chmod -R 775 pub/static/ var/ pub/media/ && run php bin/magento setup:static-content:deploy run php bin/magento cache:clean run php bin/magento cache:flush
Hope it helps !
i have a website 6 month old, i publish product review like kinderwagen test 2019 , my site now in WordPress but at this time i am planning to migrate to Magento, have any issue if i do this plz clarify me.i have some confusion.
When you install the extension, clear the static cache before you use the extension on your store. You need to do this: System > Cache Management > Flush Static Files Cache.