composer require maatwebsite/excel
If I run the avobe command I get this error..Is their any alternative…I searched a lot in online but I did not get any solution…I am using the laravel latest version
composer require maatwebsite/excel
./composer.json has been updated
Running composer update maatwebsite/excel
Loading composer repositories with package information
Updating dependencies
Lock file operations: 7 installs, 0 updates, 0 removals
- Locking composer/semver (3.4.0)
- Locking ezyang/htmlpurifier (v4.17.0)
- Locking maatwebsite/excel (3.1.51)
- Locking maennchen/zipstream-php (3.1.0)
- Locking markbaker/complex (3.0.2)
- Locking markbaker/matrix (3.0.1)
- Locking phpoffice/phpspreadsheet (1.29.0)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 7 installs, 0 updates, 0 removals
- Downloading markbaker/matrix (3.0.1)
- Downloading markbaker/complex (3.0.2)
- Downloading maennchen/zipstream-php (3.1.0)
- Downloading ezyang/htmlpurifier (v4.17.0)
- Downloading phpoffice/phpspreadsheet (1.29.0)
- Downloading composer/semver (3.4.0)
- Downloading maatwebsite/excel (3.1.51)
0/7 [>---------------------------] 0%
1/7 [====>-----------------------] 14%
2/7 [========>-------------------] 28%
4/7 [================>-----------] 57%
6/7 [========================>---] 85%
7/7 [============================] 100%
- Installing markbaker/matrix (3.0.1): Extracting archive
- Installing markbaker/complex (3.0.2): Extracting archive
- Installing maennchen/zipstream-php (3.1.0): Extracting archive
- Installing ezyang/htmlpurifier (v4.17.0): Extracting archive
Install of ezyang/htmlpurifier failed
- Installing phpoffice/phpspreadsheet (1.29.0): Extracting archive
Install of phpoffice/phpspreadsheet failed
- Installing composer/semver (3.4.0): Extracting archive
- Installing maatwebsite/excel (3.1.51): Extracting archive
Install of maatwebsite/excel failed
0 [>---------------------------] 0 [->--------------------------]
In Filesystem.php line 284:
Could not delete C:UsersreturnDesktoptask_project_crud/vendor/composer/389c7ae0ezyang- htmlpurifier-b
bc513dlibraryHTMLPurifierEntityLookup:
This can be due to an antivirus or the Windows Search Indexer locking the file while they are analyzed
require [--dev] [--dry-run] [--prefer-source] [--prefer-dist] [--prefer-install PREFER-INSTALL] [--fixed] [--no-suggest] [--no-progress] [--no-update] [--no-install] [--no-audit] [--audit-format AUDIT-FORMAT] [--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>...]
How to avoid this error….
2
Answers
you need to check maatwebsite/excel version compatible your php or laravel version if its compatible try this:
composer clear-cache ,
composer update ,
php artisan cache:clear ,
composer dump-autoload ,
composer require maatwebsite/excel
The error message indicates that Composer is unable to delete a directory
(HTMLPurifierEntityLookup)
during the installation process.Solution 1: If you have an antivirus program running, temporarily disable it and then run the composer require maatwebsite/excel command again. Antivirus programs can sometimes lock files and prevent them from being deleted during the installation process.
Solution 2: Open a command prompt as an administrator and then run the composer require maatwebsite/excel command. Running Composer with elevated privileges might help overcome permission issues.
Solution 3: You can try manually deleting the problematic directory mentioned in the error message
(C:UsersreturnDesktoptask_project_crud/vendor/composer/389c7ae0ezyang-htmlpurifier-bbc513dlibraryHTMLPurifierEntityLookup)
. After that, run thecomposer require maatwebsite/excel
command again.