Laravel-Backpack / community-forum

A workspace to discuss improvement and feature ideas, before they're actually implemented.
28 stars 0 forks source link

Unable to install Backpack #806

Closed rawad1 closed 8 months ago

rawad1 commented 8 months ago

I have this composer.json:

{ "name": "laravel/laravel", "type": "project", "description": "The skeleton application for the Laravel framework.", "keywords": [ "laravel", "framework" ], "license": "MIT", "require": { "php": "^8.1", "backpack/crud": "^6.0", "backpack/editable-columns": "", "backpack/pro": "^2.0", "backpack/theme-coreuiv2": "^1.1", "backpack/theme-coreuiv4": "", "guzzlehttp/guzzle": "^7.2", "laracasts/flash": "", "laravel/framework": "^10.10", "laravel/sanctum": "^3.2", "laravel/tinker": "^2.8", "predis/predis": "" }, "require-dev": { "backpack/devtools": "*", "backpack/generators": "^4.0", "fakerphp/faker": "^1.9.1", "laravel/pint": "^1.0", "laravel/sail": "^1.18", "mockery/mockery": "^1.4.4", "nunomaduro/collision": "^7.0", "phpunit/phpunit": "^10.1", "spatie/laravel-ignition": "^2.0" },

"autoload": {
    "psr-4": {
        "App\\": "app/",
        "Database\\Factories\\": "database/factories/",
        "Database\\Seeders\\": "database/seeders/"
    }
},
"autoload-dev": {
    "psr-4": {
        "Tests\\": "tests/"
    }
},
"scripts": {
    "post-autoload-dump": [
        "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
        "@php artisan package:discover --ansi"
    ],
    "post-update-cmd": [
        "@php artisan vendor:publish --tag=laravel-assets --ansi --force"
    ],
    "post-root-package-install": [
        "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
    ],
    "post-create-project-cmd": [
        "@php artisan key:generate --ansi"
    ],
    "post-install-cmd": [
        "php artisan storage:link"
    ]

},
"extra": {
    "laravel": {
        "dont-discover": []
    }
},
"config": {
    "optimize-autoloader": true,
    "preferred-install": "dist",
    "sort-packages": true,
    "allow-plugins": {
        "pestphp/pest-plugin": true,
        "php-http/discovery": true
    }
},

"repositories": { "0": { "type": "composer", "url": "https://repo.backpackforlaravel.com/" } }, "minimum-stability": "stable", "prefer-stable": true }

when I try to run composer update it shows:

./composer.json has been updated Running composer update backpack/devtools Loading composer repositories with package information Updating dependencies Nothing to modify in lock file Installing dependencies from lock file (including require-dev) Package operations: 1 install, 0 updates, 0 removals

In Git.php line 472:

Failed to execute git clone --no-checkout -- 'https://git...vDv:x-oauth-basic@github.com/Laravel-Backpack/DevTools.git' '/var/www/html/data-deduplicate/vendor/backpack/devtools' && cd '/var/www/html/data-deduplicate/vendor/backpack/devtools' && git remote add compo ser -- 'https://git...vDv:x-oauth-basic@github.com/Laravel-Backpack/DevTools.git' && git fetch composer && git remote set-url origin -- 'https://github.com/Laravel-Backpack/DevTools.git' && git remote set-url composer -- 'https://github.com/Laravel-Backpack/DevTool s.git'

fatal: repository 'https://git...vDv:x-oauth-basic@github.com/Laravel-Backpack/DevTools.git/' not found

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] [--] [...]

[centos@ip-172-31-44-17 data-deduplicate]$ composer config http-basic.backpackforlaravel.com rawadalzghayar70193876 J98Rgv8T5uq6 [centos@ip-172-31-44-17 data-deduplicate]$ composer config http-basic.backpackforlaravel.com rawadalzghayar70193876 J98Rgv8T5uq6 --global [centos@ip-172-31-44-17 data-deduplicate]$ nano composer.json [centos@ip-172-31-44-17 data-deduplicate]$ sudo /usr/local/bin/composer update Do not run Composer as root/super user! See https://getcomposer.org/root for details Continue as root/super user [yes]? yes Loading composer repositories with package information Updating dependencies Lock file operations: 1 install, 0 updates, 0 removals

update [--with WITH] [--prefer-source] [--prefer-dist] [--prefer-install PREFER-INSTALL] [--dry-run] [--dev] [--no-dev] [--lock] [--no-install] [--no-audit] [--audit-format AUDIT-FORMAT] [--no-autoloader] [--no-suggest] [--no-progress] [-w|--with-dependencies] [-W|--with-all-dependencies] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--apcu-autoloader-prefix APCU-AUTOLOADER-PREFIX] [--ignore-platform-req IGNORE-PLATFORM-REQ] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [-i|--interactive] [--root-reqs] [--] [...]

pxpm commented 8 months ago

Hello @rawad1

I see that in your composer.json you have some packages with "*", some without any version at all like editable-columns.

I would advise you to follow this steps: Go to your backpack user tokens page and check all the version of each package you have access to. For example if your license expired 3 months ago, you will only have access to versions released up to that date. In the page I mentioned you can find the latest version you have access, and you should put those versions in your composer.json.

If your license is not expired and you still have access to on-going updates, just set the composer version to the latest major version and composer will pick the most recent version for you. For example backpack/pro is on 2.0.23, so if you have a valid licence you can just use backpack/pro:"^2.0" in your composer.

Also, make sure your credentials are correct by using: composer config http-basic.backpackforlaravel.com [your-token-username] [your-token-password]

Cheers