I have installed magento 2 successfully on localhost but I am not able to see admin panel as it render 404 error to me.
Secondly, When I open front-end then CSS and JavaScript is not loading.They also renders 404 errors.
Also When I try to run command:
{your Magento install dir}/bin/magento setup:static-content:deploy
I got the following error
[InvalidArgumentException]
There are no commands defined in the "setup:static-content" namespace.
Here is the simplest solution if showing version name in css path
like : pub/static/version323334/
then run this query in my sql
INSERT INTO core_config_data (path, value)
VALUES ('dev/static/sign', 0)
ON DUPLICATE KEY UPDATE value = 0;
after that clear the config cache
bin/magento cache:clean config
you can also disable static file version form admin
This One Worked for Me.
use this Command php bin/magento setup:static-content:deploy
Step 1 : In CMD Open your root directory using cd command
Step 2 : php bin/magento setup:static-content:deploy
- run this Command
then,Check Your pub/static
folder, CSS and Js files will be available there
Refer this
Try the same command as root user by adding sudo like below
sudo php bin/magento setup:static-content:deploy
Changing dev/static/sign
to 0
in core config data worked for me
then,
bin/magento cache:flush
then,
php bin/magento setup:static-content:deploy -f
Though it is old question, its answers could not help me to fix my issue what would generate same error message. I suggest the followings:
tail var/log/system.log
Or find if there is any error in php error log file
If you find isolated error, fix it.
sudo rm -rf pub/static sudo rm -rf var/cache sudo rm -rf var/composer_home sudo rm -rf var/generation sudo rm -rf var/page_cache sudo rm -rf var/view_preprocessed
After deleting them, you can re-create them by executing the following commands:
sudo php bin/magento setup:static-content:deploy -f
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With