I want to create a new Laravel project using Composer. I have installed Composer and successfully ran the command composer global require laravel/installer. However, when I tried to run laravel new <project-name>, I encountered an error:
A connection timeout was encountered. If you intend to run Composer without connecting to the internet, run the command again prefixed with COMPOSER_DISABLE_NETWORK=1 to make Composer run in offline mode.
I verified that my internet connection was functioning properly. I deleted the files created by the command and tried again, but the same error occurred. I noticed that the process "Downloading laravel/pint (v1.15.0)" does not complete and results in the same error.
I then ran the commands composer clear-cache and composer install in the project directory (which contains the created files), but these actions did not resolve the issue.
You can try check internet connection/proxy or you can specify timeout like this