I have Successfully Install the Magento2 But when I try to run Homepage I getting below Errors in the console.
Then I have checked in Magento git Ripo https://github.com/magento/magento2/tree/master/pub/static
I have found the below Image All Folders are missing.
If some has that folders then please provide us…
Best Answer
The repo is up to date.
Here is how the resources in pub/static should work.
The meaning of "module" changed in magento 2. Now the files are not separated between code, template and skin. Everything goes in the same module
Vendor_Module
.When requesting a resource from
pub/static
, if the file does not exist the request is rewritten to../static.php?resource={resource name here}
.Take a look at the
.htaccess
file in the pub/static folder to understand better.You get 404 responses probably because you don't have
mod_rewrite
enabled.You should enable it.
But it can work without it.
There is a 'cache' system for these static resources.
navigate to the folderdev/tools/Magento/Tools/View
and run this in the command line[EDIT]In the later versions there is no more
dev/tools/Magento/Tools/View
folder.You can get the same effect by running this command:
[/EDIT]
This will copy the static resources from each module to the
pub/static
folder.Be patient, it will take a while.
Remember this for the future. It is recommended to do this on the live server. It will speed up the access to static resources.
But there is a catch.
If you modify one of the static resources inside a module, the changes will not be available until you run
php deploy.php
again.And you should never modify any file from
pub/static
directly. The changes will be overwritten the next time your executedeploy.php
.