Magento 2 – Can’t Find CSS and JS Files

cssjavascriptmagento2

I moved my site based on Magento 2 from hosting to my localhost.
I cleared cache, adjusted(secure and unsecure) urls in core_config, ran static content deploy using cli. Checked all permitions for "folder".

Magento runs but with no css and js files.

In console I can see following:

Printscreen of main Magento 2 page after deploying

Please give some advice, what should I do to remove this issue?
Thanks in advance!

P.S:
Win 10
Open Sever (PHP7x64, MySQL5, 7×64, Apache-PHP7-x64+Nginx1.10)
No external caching

P.P.S Before I copied site from host I tried to setup magento with sample data using cli and I received the same issue! So I believe it's not only issue about moving magento 2 from host to local.
I can see that M2 tries to load all files from version1485628564 folder which doesn't exist in pub/static
http://magehost.two/pub/static/**version1485628564**/frontend/Magento/luma/en_US/mage/calendar.css

Best Answer

Inside your Magento project folder run magento deploy:mode:set production

It will create a new folder version inside pub/static/ and should work.

As you are working localhost you can enable developer mode magento deploy:mode:set developer

Source : http://devdocs.magento.com/guides/v2.1/config-guide/cli/config-cli-subcommands-mode.html

Related Topic