Getting error while installing laravel installer in window 10

≯℡__Kan透↙ 提交于 2019-12-03 12:47:53

Do you use any antivirus? If yes try to disable then check.

Sometime Mcafe prevent to download packagist.

To resolve this, configure composer to use the https repository by running the following command on the cli before installing Laravel

composer config -g repo.packagist composer https://packagist.org

The following steps will fix most "packages.json file could not be downloaded" issue with Composer:

  1. Verify your firewall setting. Disable Firewall for starters
  2. Enable PHP OpenSSL Extension
  3. Enable PHP allow_url_fopen directive

Note: Make sure you are working with the right PHP version and Environment (apache, CLI, etc.) when you modify the php.ini file.

I believe you are facing the same issue as this and this. Composer recommends the following:

We recommend you fix your IPv6 setup. If that is not possible, you can try the following workarounds:

sadly, for the Windows workaround it says that if your setup cannot be fixed or if that didn't solve the issue then you should outright disable IPv6 which is a common answer and is also suggested here (however the video has been deleted so I've made this post to have a reliable answer).

(I've purposely aligned the windows as such so you can see the steps to the screen)

  • Open Control Panel
  • Navigate to Network and Internet
  • Click on Network and Sharing Centre
  • On the left hand side of the window click on Change adapter settings
  • Find your adapter and open the properties by right clicking on it
  • Find Internet Protocol Version 6 (TCP/IPv6) and uncheck it
  • Click OK

Edit #1

What is suggested here is:

Install a Windows level VPN or proxy switcher that acts as the default route if you need to change your IP (effectively). Try CyberGhost

and that seemed to solve the issue for the OP.

I noticed this is also happening when changing networks (moving from office to office for example). How I managed to solve it is to restart the docker container. I had this situation happening 2 times already and the same solution helped.

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