I have installed the magento2 successfully but there are a lot of js error

牧云@^-^@ 提交于 2019-12-08 17:32:06

问题


I have installed the magento2 successfully but there are a lot of js error.

When see the console log through the firebug it shows a lot of errors and is there any thing else to config for the magento css and js.


回答1:


try following :

  1. make bin/magento executable

    chmod +x bin/magento
    
  2. Clear cache etc in var folder

    rm -rf var/cache/ var/di/ var/generation/ var/page_cache/
    
  3. Run Setup ( if any thing missing )

    bin/magento setup:upgrade
    
  4. Deploy Static Content

    bin/magento setup:static-content:deploy
    
  5. Give Permission to var & pub folders

    chmod -R 777 pub/ var/
    

now all the static files containing js, css etc will be deployed in pub/static folder




回答2:


Problem solved ...

There is a 'cache' system for these static resources. navigate to the folder dev/tools/Magento/Tools/View

Run the below command in the terminal

php deploy.php

After running this command css and other files created under the Pub/static/ folder and all the css will appear and page look fine.




回答3:


Remove all files and folder in pub/static except .htaccess and then run:

php bin/magento setup:static-content:deploy



回答4:


You can try after giving full permission to magento folder




回答5:


I had the same problem. I've deleted .htaccess file from pub/static folder by mistake.

I copied the file from the original installation to pub/static directory.



来源:https://stackoverflow.com/questions/27646623/i-have-installed-the-magento2-successfully-but-there-are-a-lot-of-js-error

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!