Error Laravel Installation failed reverting composer json to its original content

0 votes

When I run this command sudo composer global require "laravel/installer" it produces this output:

Changed current directory to /home/zoheir/.composer
Do not run Composer as root/super user! See https://getcomposer.org/root for details
Using version ^1.4 for laravel/installer
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - laravel/installer v1.4.1 requires ext-zip * -> the requested PHP extension zip is missing from your system.
    - laravel/installer v1.4.0 requires ext-zip * -> the requested PHP extension zip is missing from your system.
    - Installation request for laravel/installer ^1.4 -> satisfiable by laravel/installer[v1.4.0, v1.4.1].

  To enable extensions, verify that they are enabled in your .ini files:
    - /etc/php/7.0/cli/php.ini
    - /etc/php/7.0/cli/conf.d/10-opcache.ini
    - /etc/php/7.0/cli/conf.d/10-pdo.ini
    - /etc/php/7.0/cli/conf.d/20-calendar.ini
    - /etc/php/7.0/cli/conf.d/20-ctype.ini
    - /etc/php/7.0/cli/conf.d/20-exif.ini
    - /etc/php/7.0/cli/conf.d/20-fileinfo.ini
    - /etc/php/7.0/cli/conf.d/20-ftp.ini
    - /etc/php/7.0/cli/conf.d/20-gettext.ini
    - /etc/php/7.0/cli/conf.d/20-iconv.ini
    - /etc/php/7.0/cli/conf.d/20-json.ini
    - /etc/php/7.0/cli/conf.d/20-phar.ini
    - /etc/php/7.0/cli/conf.d/20-posix.ini
    - /etc/php/7.0/cli/conf.d/20-readline.ini
    - /etc/php/7.0/cli/conf.d/20-shmop.ini
    - /etc/php/7.0/cli/conf.d/20-sockets.ini
    - /etc/php/7.0/cli/conf.d/20-sysvmsg.ini
    - /etc/php/7.0/cli/conf.d/20-sysvsem.ini
    - /etc/php/7.0/cli/conf.d/20-sysvshm.ini
    - /etc/php/7.0/cli/conf.d/20-tokenizer.ini
    - /etc/php/7.0/cli/conf.d/20-xdebug.ini
  You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.
Mar 26, 2020 in Laravel by kartik
• 37,520 points
88,248 views

2 answers to this question.

+1 vote

Hello,

You need to install php zip extension.

Something like

sudo apt-get install php7.0-zip

should get you on the right lines

Depending on installed php version you may need to change the package you need to install, eg

  • php-zip
  • php5.4-zip
  • php7.0-zip
  • php7.1-zip

Easiest way to find php version is to run

php -v

Thank You!

answered Mar 26, 2020 by Niroj
• 82,880 points

Many thanks bro

In case to get more verbose output  Try running composer install -vvv. 

Hello @Ayush

Is It possible to use with laravel 5.5?

0 votes

even though they said Tested with Laravel 5.5.* it in the readme,composer.json says it requires both

"laravel/framework": "5.4.*",
"illuminate/support": "5.4.*",

so if the package's composer.json says it should be Laravel 5.4.*. You are using laravel 5.5 so it's incompatible.

here is the rpsimao/invoicexpress-api composer.json file of tag 0.5.6. see Laravel version

{
    "name": "rpsimao/invoicexpress-api",
    "description": "Laravel Package to interact with InvoiceXpress API",
    "type": "library",
    "keywords": [
        "laravel",
        "rpsimao",
        "invoicexpress-api",
        "invoicexpress",
        "api"
    ],
    "homepage": "https://github.com/rpsimao/invoicexpress-api",
    "license": "MIT",
    "authors": [
        {
            "name": "Ricardo Simão",
            "email": "ricardo.simao@upgrade.pt"
        }
    ],
    "require": {
        "php": "^7.0",
        "guzzlehttp/guzzle": "^6.2.1",
        "guzzlehttp/psr7": "^1.4.1",
        "guzzlehttp/promises": "~1.0",
        "laravel/framework": "5.4.*",
        "illuminate/support": "5.4.*",
        "spatie/array-to-xml": "^2.5"
    },
    "autoload": {
        "psr-4": {
            "rpsimao\\InvoiceXpressAPI\\": "src/"
        },
        "files":[
            "src/Helpers/invoicexpress-api.php"
        ]
    },
    "require-dev": {
        "phpunit/phpunit": "^6.1",
        "orchestra/testbench": "^3.4"
    },
    "autoload-dev": {
        "psr-4": {
            "rpsimao\\InvoiceXpressAPI\\Test\\": "tests/"
        }
    },
    "extra": {
    "laravel": {
        "providers": [
            "rpsimao\\InvoiceXpressAPI\\InvoiceXpressAPIServiceProvider"
        ],
        "aliases": {
            "InvoiceXpressClients": "rpsimao\\InvoiceXpressAPI\\InvoiceXpressAPIFacade"
           }
        }
    }
}

AFTER EDIT

So, currently it's not possible to use with Laravel 5.5 as Laravel 5.5 uses PHP >=7.0.0 too, this package uses Laravel 5.4 which uses PHP >=5.6.4.

Learn more about these tools with our Frontend Developer courses.

answered Dec 16, 2020 by Gitika
• 65,890 points

Related Questions In Laravel

+1 vote
3 answers

Error: Exception file_put_contents failed to open stream: No such file or directory in Laravel?

Hello, You should typically run the php artisan config:cache command ...READ MORE

answered Mar 31, 2020 in Laravel by Niroj
• 82,880 points
48,763 views
0 votes
2 answers

Error:Failed to open stream: Permission denied in Laravel?

I had this problem lately with my ...READ MORE

answered Nov 4, 2020 in Laravel by anonymous
• 140 points
16,852 views
+1 vote
1 answer

Error:file_put_contents(meta/services.json): failed to open stream: Permission denied?

Hello @kartik, Below steps helped me fix the ...READ MORE

answered Apr 3, 2020 in Laravel by Niroj
• 82,880 points
8,616 views
0 votes
1 answer

Error:Laravel 5 show ErrorException file_put_contents failed to open stream: No such file or directory

Hello @kartik, The best way to solve this ...READ MORE

answered Aug 10, 2020 in Laravel by Niroj
• 82,880 points
6,453 views
+1 vote
1 answer

How to make anchor tag with routing using Laravel?

Hey @kartik, First you have to go to ...READ MORE

answered Mar 18, 2020 in Laravel by Niroj
• 82,880 points
22,938 views
0 votes
1 answer

What is redirection in Laravel?

Named route is used to give specific ...READ MORE

answered Mar 18, 2020 in Laravel by Niroj
• 82,880 points
2,960 views
0 votes
1 answer

How to install Laravel via composer?

Hello, This is simple you just need to ...READ MORE

answered Mar 23, 2020 in Laravel by Niroj
• 82,880 points
2,894 views
+1 vote
1 answer

What are named routes in Laravel and How can specify route names for controller actions?

Hey @kartik, Named routing is another amazing feature of ...READ MORE

answered Mar 23, 2020 in Laravel by Niroj
• 82,880 points
44,358 views
0 votes
1 answer

Error: reverting ./composer.json to its original content

Hello @kartik, I used to use this: composer require ...READ MORE

answered Sep 11, 2020 in Laravel by Niroj
• 82,880 points
3,493 views
0 votes
2 answers
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP