Can't Install Laravel Installer via Composer

Can't install laravel installer via composer

It says that it requires zip extension

laravel/installer v1.4.0 requires ext-zip...

Install using (to install the default version):

sudo apt install php-zip

Or, if you're running a specific version of PHP:

# For php v7.0
sudo apt-get install php7.0-zip

# For php v7.1
sudo apt-get install php7.1-zip

# For php v7.2
sudo apt-get install php7.2-zip

# For php v7.3
sudo apt-get install php7.3-zip

# For php v7.4
sudo apt-get install php7.4-zip

Solution - Error during composer global require laravel/installer

The culprit in my problem is the laravel/homestead:v2.0 which requires lower version of everything else which conflicts with the higher version the laravel/installer requires.

I edited my composer.json, removed everything except the codesniffer and required the latest laravel/installer version and it should install smoothly. The whole process did not install the laravel/homestead automatically so I also manually required it and it ended up looking like this:

{
"require": {
"squizlabs/php_codesniffer": "^3.6",
"symfony/console": "v6.0.3",
"laravel/installer": "4.2.10",
"laravel/homestead": "^13.2"
}
}

Your laravel/installer should now work fine. And the laravel new project-name command should working as intended.

PS: Your composer.json location would be shown in the terminal but just in case, the default path would be:

C:/Users/{Your user name}/AppData/Roaming/Composer



Related Topics



Leave a reply



Submit