TopAngler
TopAngler

Reputation: 109

Composer Error Installing laravel/installer in Windows 10

I am using Windows 10 and composer. I'm getting an error when I attempt to install the laravel installer. Any help would be greatly appreciated. Here is the full output when I attempt to install:

$ composer global require laravel/installer
Changed current directory to C:/Users/rudy/AppData/Roaming/Composer
Using version ^4.1 for laravel/installer
./composer.json has been created
Running composer update laravel/installer
Loading composer repositories with package information
Updating dependencies
Lock file operations: 12 installs, 0 updates, 0 removals
  - Locking laravel/installer (v4.1.0)
  - Locking psr/container (1.0.0)
  - Locking symfony/console (v5.1.8)
  - Locking symfony/polyfill-ctype (v1.20.0)
  - Locking symfony/polyfill-intl-grapheme (v1.20.0)
  - Locking symfony/polyfill-intl-normalizer (v1.20.0)
  - Locking symfony/polyfill-mbstring (v1.20.0)
  - Locking symfony/polyfill-php73 (v1.20.0)
  - Locking symfony/polyfill-php80 (v1.20.0)
  - Locking symfony/process (v5.1.8)
  - Locking symfony/service-contracts (v2.2.0)
  - Locking symfony/string (v5.1.8)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 12 installs, 0 updates, 0 removals
  - Installing symfony/polyfill-php80 (v1.20.0): Extracting archive
  - Installing symfony/process (v5.1.8): Extracting archive
  - Installing symfony/polyfill-mbstring (v1.20.0): Extracting archive
  - Installing symfony/polyfill-intl-normalizer (v1.20.0): Extracting archive
  - Installing symfony/polyfill-intl-grapheme (v1.20.0): Extracting archive
  - Installing symfony/polyfill-ctype (v1.20.0): Extracting archive
  - Installing symfony/string (v5.1.8): Extracting archive
  - Installing psr/container (1.0.0): Extracting archive
  - Installing symfony/service-contracts (v2.2.0): Extracting archive
  - Installing symfony/polyfill-php73 (v1.20.0): Extracting archive
  - Installing symfony/console (v5.1.8): Extracting archive
  - Installing laravel/installer (v4.1.0): Extracting archive
    Skipped installation of bin bin/laravel for package laravel/installer: name conflicts with an existing file
6 package suggestions were added by new dependencies, use `composer suggest` to see details.
Generating autoload files

Installation failed, deleting ./composer.json.


  [RuntimeException]
  Could not scan for classes inside "C:\Users\rudy\AppData\Roaming\Composer\vendor/symfony/polyfill-php73/Resources/s
  tubs" which does not appear to be a file nor a folder


require [--dev] [--dry-run] [--prefer-source] [--prefer-dist] [--fixed] [--no-suggest] [--no-progress] [--no-update] [--no-install] [--no-scripts] [--update-no-dev] [-w|--update-with-dependencies] [-W|--update-with-all-dependencies] [--with-dependencies] [--with-all-dependencies] [--ignore-platform-req IGNORE-PLATFORM-REQ] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [--sort-packages] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--apcu-autoloader-prefix APCU-AUTOLOADER-PREFIX] [--] [<packages>]...

Upvotes: 3

Views: 5059

Answers (7)

Schotti100
Schotti100

Reputation: 149

I had problems with 7 zip i fixed it by enabling the zip extension in my php.ini

Upvotes: 0

ciao1092
ciao1092

Reputation: 118

For me, the problem was 7zip. Composer was using 7z.exe from Lua (which I had previously installed). When I installed 7z from the official site and updated the PATH variable, this error was solved.
I can't provide an explanation though, I am not sure what happened...

Upvotes: 1

Having the cache cleared did work for me as well. here are what I do:

  1. composer clearcache
  2. composer global require laravel/installer and the installation went successfully

Upvotes: 0

TopAngler
TopAngler

Reputation: 109

I reinstalled Composer 4 times before making this post. After unsuccessfully trying the solutions above, I tried reinstalling composer again and then ran the laravel/installer - and it worked fine. Thanks to everyone who took the time to reply.

Upvotes: 0

Adhitya
Adhitya

Reputation: 665

You Have Problem with symfony/polyfill
Delete Manually Vendor and composer.lock

Or
Cleaning composer cache worked for me:

composer clearcache

Then Install your package

Upvotes: 3

Rahul Gupta
Rahul Gupta

Reputation: 24

You can try downloading and installing the composer.exe

Upvotes: 0

Harshana
Harshana

Reputation: 5476

This usually happens when the files are corrupted in your local environment. Try removing cache and re-installing the packages

$ composer clearcache
$ composer global require laravel/installer

Upvotes: 3

Related Questions