PHPOffice / PhpSpreadsheet

A pure PHP library for reading and writing spreadsheet files
https://phpspreadsheet.readthedocs.io
MIT License
13.14k stars 3.36k forks source link

Root package 'phpoffice/phpspreadsheet' cannot require itself in its composer.json #3881

Closed WhiteDragonD closed 5 months ago

WhiteDragonD commented 5 months ago

installed Composer through Windows/WAMP, When inside the directory of composer.json and running the require command:

D:\wamp\Server Apps Scripts\phpspreadsheet>composer require phpoffice/phpspreadsheet Root package 'phpoffice/phpspreadsheet' cannot require itself in its composer.json

Help?

Composer version 2.6.6 2023-12-08 18:32:26 PHP 8.1.8

WhiteDragonD commented 5 months ago

I found a Chinese website that had a picture saying remove this line in composer.json

"name": "phpoffice/phpspreadsheet",

https://blog.csdn.net/m0_47175673/article/details/132000933

D:\wamp\Server Apps Scripts\phpspreadsheet>composer require phpoffice/phpspreadsheet ./composer.json has been updated Running composer update phpoffice/phpspreadsheet Loading composer repositories with package information Updating dependencies Lock file operations: 1 install, 0 updates, 0 removals

D:\wamp\Server Apps Scripts\phpspreadsheet>composer install Installing dependencies from lock file (including require-dev) Verifying lock file contents can be installed on current platform. Package operations: 83 installs, 0 updates, 0 removals

D:\wamp\Server Apps Scripts\phpspreadsheet>

PowerKiKi commented 5 months ago

This is an incorrect use of composer. Not a bug in PhpSpreadsheet.

WhiteDragonD commented 5 months ago

I am a newb.... was just following the instructions without knowing what to do :D