Failing to install Spark in an existing laravel project - laravel

I have an existing laravel project where I want to install spark.
I have a spark licence.
When I add the following in composer.json
"repositories": [
{
"type": "composer",
"url": "https://spark-satis.laravel.com"
}
],
And add the following dependency in composer.json's require section
"laravel/spark-aurelius": "~7.0",
The next step is to run composer update : During this process I provide token generated from github and it is where the installation fails with the following message:
Downloading (failed) Failed to download laravel/spark-aurelius from dist: The "https://api.github.com/repos/laravel/spark-aurelius/zipball/15585c1e0407623cb218f556144928a380949e9c" file could not be downloaded (HTTP/1.1 404 Not Found)
Now trying to download from source
And composer fails to clone the github repo (laravel-/spark-aurelius)
This exception is thrown
[RuntimeException]
Failed to execute git clone --no-checkout "https://***:***#github.com/laravel/spark-aurelius.git" "C:\laragon\www\test\vendor\laravel\spark-aurelius" && cd
/D "C:\laragon\www\test\vendor\laravel\spark-aurelius" && git remote add composer "https://***:***#github.com/laravel/spark-aurelius.git" && git fetch com
poser
How can I fix this issue

Related

Lumen throwing error: Uncaught Error: Class 'Laravel\Lumen\Bootstrap\LoadEnvironmentVariables' not found in /var/www/bootstrap/app.php:5

I am working on a Laravel Lumen project. I am trying to spin up the existing project locally. First I installed the composer by running, "composer install". When I run the migration command, "php artisan migrate", I am getting the following error.
Fatal error: Uncaught Error: Class 'Laravel\Lumen\Bootstrap\LoadEnvironmentVariables' not found in /var/www/bootstrap/app.php:5
Stack trace:
#0 /var/www/artisan(18): require()
#1 {main}
thrown in /var/www/bootstrap/app.php on line 5
I tried deleting the vendor folder and running composer install again. It did not work. The class does not seem to exist either. But the composer was installed successfully. I am using Lumen version 7.0. What is wrong with it and how can I fix it?
Make sure you actually require the lumen package i.e. make sure your composer.json contains:
"require": {
"php": "^7.2.5",
"laravel/lumen-framework": "^7.0"
},
Afterwards run composer install again. If it worked then a folder /vendor/laravel/lumen-framework should be present
See official composer.json template for Lumen 7.0: https://github.com/laravel/lumen/blob/7.x/composer.json

Runtime Exception - Repository not found

With and old laravel 5.5 project i am having this problem.
A package I was using has been removed from github and when i try composer install I get:
[RuntimeException]
Failed to execute git clone --mirror 'https://***:***#github.com/dangeroustry/FattureCloud.git' '/home/mir
co/.cache/composer/vcs/https---github.com-dangeroustry-FattureCloud.git/'
Cloning into bare repository '/home/username/.cache/composer/vcs/https---github.com-dangeroustry-FattureCloud
.git'...
remote: Repository not found.
fatal: repository 'https://github.com/dangeroustry/FattureCloud.git/' not found
So I tried to remove this package with composer remove vendor/package but I can't remove it.
When i run the command
composer remove vendor/kiboko/fatture-cloud-laravel/
I get this error
[Composer\Downloader\TransportException]
The "https://api.github.com/repos/dangeroustry/FattureCloud/zipball/4c4133a965985c1b8c6e41bbfb47ec912a167681" file could not be downlo
aded (HTTP/2 404 )
How to solve this loop?

Github-actions - composer fails with 'sh: git: not found'?

I have a wordpress plugin where i'm using composer to define my dependent libaries and github-actions to build the installable package. I plan to publish the vendors folder to a 'build' branch in github so the whole application can be installed.
My composer.json file has this content and works locally
{
"name" : "emeraldjava/bhaa_wordpress_plugin",
"description" : "bhaa_wordpress_plugin",
"type" : "wordpress-plugin",
"require": {
"scribu/scb-framework": "dev-master",
"scribu/lib-posts-to-posts": "dev-master",
"mustache/mustache": "2.12.0",
"league/csv": "^9.1",
"michelf/php-markdown": "^1.8"
},
and my github-actions build.yml file uses 'MilesChou/composer-action' to install the composer env in the docker container
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout#v1
- name: Composer install
uses: MilesChou/composer-action/7.3#master
with:
args: install --no-dev
- uses: docker://php:7.3-alpine
- uses: docker://alpine/git:latest
From the build log, I can see that the zip files for these composer artifacts have been downloaded to the cache
36/38: https://codeload.github.com/scribu/wp-scb-framework/legacy.zip/95b23ac342fce16bf5eb8d939ac5a361b94b104b
37/38: https://codeload.github.com/sebastianbergmann/phpunit/legacy.zip/a7834993ddbf4b0ed2c3b2dc1f3b1d093ef910a9
38/38: https://codeload.github.com/scribu/wp-lib-posts-to-posts/legacy.zip/a695438e455587fa228e993d05b4431cde99af1b
Finished: success: 38, skipped: 0, failure: 0, total: 38
The build then failed with this 'sh: git: not found' error
Package operations: 5 installs, 0 updates, 0 removals
- Installing scribu/scb-framework (dev-master 95b23ac): Cloning 95b23ac342
Failed to download scribu/scb-framework from source: Failed to clone https://github.com/scribu/wp-scb-framework.git, git was not found, check that it is installed and in your PATH env.
sh: git: not found
Now trying to download from dist
- Installing scribu/scb-framework (dev-master 95b23ac): Loading from cache
- Installing scribu/lib-posts-to-posts (dev-master a695438): Cloning a695438e45
Failed to download scribu/lib-posts-to-posts from source: Failed to clone https://github.com/scribu/wp-lib-posts-to-posts.git, git was not found, check that it is installed and in your PATH env.
sh: git: not found
Now trying to download from dist
- Installing scribu/lib-posts-to-posts (dev-master a695438): Loading from cache
- Installing mustache/mustache (v2.12.0): Loading from cache
- Installing michelf/php-markdown (1.8.0): Loading from cache
- Installing league/csv (9.4.1): Loading from cache
I'm assuming i need to ensure the docker container had git installed, but it seems odd that composer can access the legacy.zip file, so why it git needed at this stage?
EDIT 1
I guess the quick fix here is a duplicate of this issue, and as the answer below states.
For the sake of completeness, lets assume i can't call 'composer --prefer-dist' how could i ensure the docker container has git available to it?
By default Composer uses dist (zip files) for tagged releases and source (git clone) for branches. Since you're targeting master branch for your dependencies, Composer tries to clone repositories first. You can override this behavior by using --prefer-dist switch:
with:
args: install --prefer-dist --no-dev
--prefer-dist: Reverse of --prefer-source, Composer will install from dist if possible. This can speed up installs substantially on build
servers and other use cases where you typically do not run updates of
the vendors. It is also a way to circumvent problems with git if you
do not have a proper setup.
https://getcomposer.org/doc/03-cli.md#install-i

Composer installs only globally (Windows 10)

When I try to install Composer (exe installer, curl, tried all methods), it installs only in C:\ProgramData\ComposerSetup\bin and never localy, even if I run it (obviously) from another directory.
When I run composer init - it does not create json config anywhere, composer install - is installing only in C:/Users/Username/AppData/Roaming/Composer/
D:\test>composer init
←[37;44m ←[39;49m
←[37;44m Welcome to the Composer config generator ←[39;49m
←[37;44m ←[39;49m
This command will guide you through creating your composer.json config.
Package name (<vendor>/<name>) [←[33mUsername/test←[39m]: test/test
Description []:
Author []: test <test#test.test>
Minimum Stability []:
Package Type []:
License []:
Define your dependencies.
Would you like to define your dependencies (require) interactively [←[33myes←[39m]?
Search for a package:
Would you like to define your dev dependencies (require-dev) interactively [←[33myes←[39m]?
Search for a package:
{
"name": "test/test",
"authors": [
{
"name": "test",
"email": "test#test.test"
}
],
"require": {}
}
D:\test>dir
29.08.2015 12:39 <DIR> .
29.08.2015 12:39 <DIR> ..
0 files
D:\test>composer require slim/slim -vvv
Reading ./composer.json
Loading config file ./composer.json
Executing command (CWD): git describe --exact-match --tags
Executing command (CWD): git branch --no-color --no-abbrev -v
Executing command (CWD): hg branch
Executing command (CWD): svn info --xml
Reading C:/Users/Username/AppData/Roaming/Composer/composer.json
Loading config file C:/Users/Username/AppData/Roaming/Composer/composer.json
Executing command (CWD): git describe --exact-match --tags
Executing command (CWD): git branch --no-color --no-abbrev -v
Executing command (CWD): hg branch
Executing command (CWD): svn info --xml
Downloading https://packagist.org/packages.json
Writing C:/Users/Username/AppData/Local/Composer/repo/https---packagist.org/packages.json into cache
Reading C:/Users/Username/AppData/Local/Composer/repo/https---packagist.org/p-provider-2013.json from cache
Reading C:/Users/Username/AppData/Local/Composer/repo/https---packagist.org/p-provider-2014.json from cache
Reading C:/Users/Username/AppData/Local/Composer/repo/https---packagist.org/p-provider-2014-10.json from cache Reading C:/Users/Username/AppData/Local/Composer/repo/https---packagist.org/p-provider-2015-01.json from cache Reading C:/Users/Username/AppData/Local/Composer/repo/https---packagist.org/p-provider-2015-04.json from cache Downloading http://packagist.org/p/provider-2015-07$bf4d7ab35da85686431ee3c47d0d6d2eee3d913013b38506fbc197c5e95c2420.json
Writing C:/Users/Username/AppData/Local/Composer/repo/https---packagist.org/p-provider-2015-07.json into cache Downloading http://packagist.org/p/provider-latest$ee6937b535cc76629a8e81c4362790bd14ce6a824def5d75f7222438e756a7b0.json
Writing C:/Users/Username/AppData/Local/Composer/repo/https---packagist.org/p-provider-latest.json into cache
Reading C:/Users/Username/AppData/Local/Composer/repo/https---packagist.org/provider-slim$slim.json from cache Using version ←[32m^2.6←[39m for ←[32mslim/slim←[39m
←[32m./composer.json has been updated←[39m
Reading ./composer.json
Loading config file ./composer.json
Executing command (CWD): git describe --exact-match --tags
Executing command (CWD): git branch --no-color --no-abbrev -v
Executing command (CWD): hg branch
Executing command (CWD): svn info --xml
Reading C:/Users/Username/AppData/Roaming/Composer/composer.json
Loading config file C:/Users/Username/AppData/Roaming/Composer/composer.json
Executing command (CWD): git describe --exact-match --tags
Executing command (CWD): git branch --no-color --no-abbrev -v
Executing command (CWD): hg branch
Executing command (CWD): svn info --xml
←[32mLoading composer repositories with package information←[39m
Downloading https://packagist.org/packages.json
Writing C:/Users/Username/AppData/Local/Composer/repo/https---packagist.org/packages.json into cache
←[32mUpdating dependencies (including require-dev)←[39m
Reading C:/Users/Username/AppData/Local/Composer/repo/https---packagist.org/p-provider-2013.json from cache
Reading C:/Users/Username/AppData/Local/Composer/repo/https---packagist.org/p-provider-2014.json from cache
Reading C:/Users/Username/AppData/Local/Composer/repo/https---packagist.org/p-provider-2014-10.json from cache Reading C:/Users/Username/AppData/Local/Composer/repo/https---packagist.org/p-provider-2015-01.json from cache Reading C:/Users/Username/AppData/Local/Composer/repo/https---packagist.org/p-provider-2015-04.json from cache Reading C:/Users/Username/AppData/Local/Composer/repo/https---packagist.org/p-provider-2015-07.json from cache Reading C:/Users/Username/AppData/Local/Composer/repo/https---packagist.org/p-provider-latest.json from cache
Reading C:/Users/Username/AppData/Local/Composer/repo/https---packagist.org/provider-slim$slim.json from cache Analyzed 63 packages to resolve dependencies
Analyzed 45 rules to resolve dependencies
- Installing ←[32mslim/slim←[39m (←[33m2.6.2←[39m)
Reading C:/Users/Username/AppData/Local/Composer/files/slim/slim/20a02782f76830b67ae56a5c08eb1f563c351a37.zip from cache
Loading from cache
Extracting archive
REASON: Required by root: Install command rule (install slim/slim 2.6.0|install slim/slim 2.6.1|install slim/slim 2.6.2)
←[32mWriting lock file←[39m
←[32mGenerating autoload files←[39m
Any ideas how to fix it?
Before applying all steps, try step 5 with your current setup.
Installation Steps
Manually download: https://getcomposer.org/composer.phar
place composer.phar into your PHP folder, next to php.exe
add a batch file composer.bat in the same folder (to execute composer a bit easier), with the following content:
#echo off
:: Composer CLI Shortcut (Global Installation)
"%~dp0php.exe" "%~dp0composer.phar" %*
pause
add the PHP folder to your ENV path, so that php and composer are available on any path
then create your new project
mkdir slim
cd slim
composer require slim/slim 2.6.2 -vvv (this time with version)

Problems installing Laravel 4 on Windows 7 using XAMP

After installing Composer, I then went to c:\xampp\htdocs and executed the following command:
composer create-project laravel/laravel khandakhulu --prefer-dist
I then get the following error:
[Composer\Repository\RepositorySecurityException] The contents of http://packagist.org/p/laravel/laravel$a996426ffd2d6fcd0d9a 2dfdd97171b28b3d196d34061f15d79ce67004b9c19d.json do not match its signatur e. This should indicate a man-in-the-middle attack. Try running composer ag ain and report this if you think it is a mistake.
Basically we need to force the composer use https repository at composer.json as we know from Laravel.io Forum
But we don't have any skeleton of laravel project. So, use Laravel Installer instead. This global installation generate composer.json at ~/.composer/composer.json and modify to this
{
"require": {
"laravel/installer": "~1.1"
},
"repositories": {
"packagist": { "url": "https://packagist.org", "type": "composer" }
}
}
First time installation of Laravel Installer maybe will get same error, after you force the respository URL. Finally, create your new Laravel application.
~/.composer/vendor/bin/laravel -v new justapp

Resources