Installed Cartalyst Sentry on Laravel 4 - missing src files - php

I've installed Sentry on Laravel 4 through composer following these instructions but the vendor/cartalyst/sentry/src folder is empty. Why is that? Does anyone know? I didn't get any errors during composer update.
Thanks a lot!

Sentry didn't install properly because I also used the fzaninotto/faker package in my app. I guess they just don't work well together. After removing fzaninotto/faker package from my composer.json file and re-running composer update it worked perfectly.

Related

Laravel PackageManifest.php: Undefined index: name

I'm just trying to deploy my application and I just ran composer update on my server and I got the following error:
In PackageManifest.php line 122:
Undefined index: name
How can I fix this issue?
As a temporary fix, try this, it worked for me, in the following file:
vendor/laravel/framework/src/Illuminate/Foundation/PackageManifest.php
Find line 116 and comment it:
$packages = json_decode($this->files->get($path), true);
Add two new lines after the above commented line:
$installed = json_decode($this->files->get($path), true);
$packages = $installed['packages'] ?? $installed;
I had the same problem, I just execute the command:
composer update
this will updated the composer.lock file.
After that worked like a charm.
I found this issue on the composer GitHub repo that helped a lot
I updated my Laravel framework from 5.8 to 5.8.38, following the table displayed in that issue and the error disappeared.
This Laravel blog post also helps
If you can't upgrade Laravel, you can just stay with Composer 1 by running
composer self-update --1
I recently switched composer 2.0.8 and my Laravel version is 6.20.27
To solve this issue:
Step 1:
Delete compose.lock File
Step 2:
Install dependencies.
composer install
I had the same problem.
In my case downgrading the composer version fixed the problem.
They updated Composer 4 times within 2 days - I think they had a problem with their newest updates.
In my case version 1.10.1 was the version to go with.
sudo composer self-update --1
I hope it'll work.
I had a problem like this, and also tried composer self-update --stable, but there was no result. So, I found that this file belongs to the Laravel framework. So the following command resolved this issue:
$ composer update laravel/framework
In my case downgrading the composer version fixed the problem.
sudo composer self-update --1
https://github.com/composer/composer/issues/9340#issuecomment-716210369
As stated in here, your laravel version may conflict with composer 2
composer update laravel/framework
should fix your problem :D
The easiest way to solve this issue is
delete composer.lock file from your project.
Run composer install
I was facing the same issue. I Saw my Laravel framework version is "laravel/framework": "6.0"
So just put the cap before the version and it starts working fine.
"laravel/framework": "^6.0"
Running the following command worked for me. Maybe this will help someone needy.
composer update
I removed my vendor folder and composer.lock and ran composer install again. This solved it for me.
Running composer update worked for my project with Laravel 5.7
Some versions of composer give this error, the version 1.10.20 doesn't throw this error
composer self-update 1.10.20
composer install
For my Laravel 5.7 project deleting vendor folder and composer.lock file fixed the issue.
I have a solution:
Delete the vendor folder.
run composer install
Don't use --no-scripts. This will cause a problem, and will not create the appropiate folders which the file PackageManifest.php and others need.
run composer update
This is so you don't have problems with bugs in the file.
Try this, it is worked for me, in the following file:
vendor/laravel/framework/src/Illuminate/Foundation/PackageManifest.php
Find this line and comment on it
$packages = json_decode($this->files->get($path), true);
Add two new lines after the above-commented line
$installed = json_decode($this->files->get($path), true);
$packages = $installed['packages'] ?? $installed;
If you want to fix without making updates and composer updates
just go to vendor/composer and remove installed.json
Running the following command fixed it for us
composer self-update --stable
No need to force an upgrade on your packages (running composer update on production is not recommended anyway) or downgrade your Composer if it's on version 2.
If you have a website that requires Composer v1 for updates (because, for example, v2 causes errors) and you have version v2 installed globally, the quickest solution is:
Step 1
Download the latest stable 1.x composer.phar from https://getcomposer.org/download/ (under Manual Download).
Step 2
Place the downloaded composer.phar file in the root of your project (where the composer.json file resides).
Step 3
Run your command using the composer.phar file. Example:
php composer.phar install
To downgrade composer to an old version:
composer self-update <version>
Example:
composer self-update 1.10.1
here's a solution that worked for me. https://github.com/composer/composer/issues/9340#issuecomment-716210369
change your laravel framework to 6.18.7 so that its compatible with composer 2
If you have composer version 2 upgrade your laravel to 6.2.
https://github.com/composer/composer/issues/9340#issuecomment-716210369
I had the same problem after i clone an laravel project and start composer install. Then I read through some solutions here. In my opinion, it is not a good idea to edit the laravel core. But if it's just for testing, why not.
My solution in my case was composer update instead composer install. In the case of composer update, it does not use the composer.lock file and updates the packages from composer.json. For me and in my special case works.
On my computer composer version 2.0.9 was installed, I had the same problem when upgrade laravel project.
the solution is :
Delete Vendor folder inside your project if exist.
inside composer.json for laravel version write this "laravel/framework": "^6.0" don't forget ^ in front of 6.0 it needs to install latest version of laravel 6
then composer update
finally, it works perfectly.
I updated to Composer 2.0.11 and I had the error. Downgraded to Composer 1.10.20, it worked great, BUT IT'S VERY VERY SLOW.
So for those like me who don't want to change the vendor code, and still want Composer 2.0.x know that it was a kind of bug in Laravel, and Laravel has fixed it in minor versions (or hotfixes). I was using Laravel 5.7.9 and my vendor/laravel/framework/src/Illuminate/Foundation/PackageManifest.php ->build() was like:
if ($this->files->exists($path = $this->vendorPath.'/composer/installed.json')) {
$packages = json_decode($this->files->get($path), true);
}
But in Laravel 5.7.29 PackageManifest.php , the same file is fixed:
if ($this->files->exists($path = $this->vendorPath.'/composer/installed.json')) {
$installed = json_decode($this->files->get($path), true);
$packages = $installed['packages'] ?? $installed;
}
Same goes for Laravel 5.6.0 that had the bug, and is fixed in 5.6.40 Laravel 5.6.40 PackageManifest.php. I don't know from which minor version it has been fixed at each level, but I suggest to go for the last, like 5.7.29, 5.6.40 etc. Or you can go look the versions to see if it has been fixed.
NOW COMPOSER 2.0 IS VERY VERY FAST.
If the error is after self updating the composer, just replace composer with composer1.Just change:
composer install ...
into:
composer1 install ...
Just this!
I got this issue because of a Laravel and composer version are not compatible.
Following are the steps I follow to solve this issue:
I update Laravel version from 6.1 to 6.20 in composer.json file Eg: "laravel/framework": "6.20.*"
then delete composer.lock file.
And run composer install command
Now Problem is fixed. :)
run a composer upgrade.
This work for me on laravel 7

How to install tinymce package with composer in laravel

I am trying to use tinymce with Laravel 5.2.
Till now I am done with composer require tinymce/tinymce and composer update.
The package got installed in vendor directory with the directory name tinymce.
What are the next steps ? I guess we have to add PackageServiceProvider in app/config/app.php but how ?
Thanks in advance,
Sambhav
I found this lib of tinymce for laravel. you can try it.
https://github.com/ktquez/laravel-tinymce

Installing Yii2: Invalid Parameter – yii\base\InvalidParamException

I'm installing Yii2 in the way that shows the Getting Started tutorial:
composer global require "fxp/composer-asset-plugin:~1.1.1"
composer create-project --prefer-dist yiisoft/yii2-app-basic basic
When I try to access localhost/YiiTutorial/basic/web I get this error:
Invalid Parameter – yii\base\InvalidParamException
The file or directory to be published does not exist: C:\wamp\www\YiiTutorial\basic\vendor\bower/jquery/dist
In the tutorial says that is nothing to edit... it should work right out of the box... what I'm missing?
If I download the package and place it in the same folder, it works perfect, but I want to install it from composer!
Inside vendor/bower folder it's another one called bower-asset.
Copy this folder content (some other folders named bootstrap, jquery, etc...) and move them to vender/bower.
it a recent bug. update your fxp plugin to latest version (1.1.1) and clear composer's cache and try :
composer self-update
composer global update
composer update
Mainly if not issue regarding to vendor installation so please give permission to your /assets and /runtime folers of your projects and try to run again.
In your vendor folder you should rename bower-asset to bower .
OR you can use the following
make sure that you have the following in your composer.json:
composer.json
Other ways
I have encountered this kind of problem lately, the issue is in your composer it missing the asset-plugins which allows managing bower and npm package dependencies through Composer. Just run this command, you only need to run this command once for all. You can read the yii2 docs. Yii2 Installation
composer global require "fxp/composer-asset-plugin:^1.2.0"

Laravel 4.2 install on windows

I want to install Laravel 4.2 installation some packages via Composer. However, I am getting an error
“failed to clone git#github.com:symphony/Translation.git.git was not found. Check that it is installed in your path env. ‘git’ is not recognized as an internal or external command”
I want to use version 4.2.0 which is an older version of laravel. I’m successful to download if I do not mention version number but not when I include version number.
I tried:
C:\xampp\htdocs\laravel composer create-project laravel/laravel newapp 4.2 –prefer-dist
Or
C:\xampp\htdocs\laravel composer create-project laravel/laravel newapp –prefer-dist 4.2.0
Or
C:\xampp\htdocs\laravel composer create-project laravel/laravel newapp –prefer-dist 4.2.*
Or
C:\xampp\htdocs\laravel composer create-project laravel/laravel {{newapp}} 4.2.* –prefer-dist *
All with same error...
What do I need to make it work? Do I need to install git but How? i have no idea thanks for your help.
Note:I have latest composer downloaded yesterday July 24
Why do you want to use an old and not updated version of Laravel?
The first one is the correct way to install Laravel with composer/create-project.
Can you try to clone the laravel/laravel repository and to run composer udpate?
Lynda was a good source of information for me to learn Laravel(4.2) and if I recall there was a course that went into detail on installing Laravel on Windows, I could be wrong but if you have Git installed already you will also need to add it as a variable in your Paths to be used in your prompts.
The link below should help you in setting the Paths to Git and they should be something along these lines.
;"C:\path\git\bin";"C:\path\git\cmd"
http://www.computerhope.com/issues/ch000549.htm
I bullishly downloaded and installed GIT not knowing option to choose (used command prompt option) as Romain suggested , reboot and retried and it worked. Lynda indeed have a chapter on installation but did not mention Git so following instruction failed. Note: only trying previous version failed, was ok for latest laravel 5 version before installation of Git. Thank you all...one day lost of trying and testing but happy ending :)

Laravel 4 Package installation using composer

I need to know how to install packages in laravel 4.
I have downloaded a bundle from github, but executing the bundle, I see it is deprecated in Laravel 4. Can anyone please help me.
Just using packagist, you can go to packagist.org , after that just put the package name at require key in your composer.json on your laravel project, and that run this command , composer update or compose install
in example :
// composer.json
"require": {
// default value..
"intervention/image": "dev-master",
}
i hope this help
Laravel 4 now uses composer to install packages.
You can add new packages to laravel via a few options on composer. One is on the command line.
> composer require author/package
> dev-master
After issuing the require command it will ask you what version to use. then run composer update, add the PackageServiceProvider to your app/config/app.php
First and always if you plan to use composer in your work, learn the basics of it (what is composer.json,composer.lock...)
There is excellent video on Laracasts https://laracasts.com/lessons/you-must-use-composer
That way you can avoid problems and enjoy using this great package manager.
Next use composer dump(-autoload) command frequently and composer self-update.
If that bundle is deprecated in Laravel4 than it is deprecated and you can't use it ( unless author made some changes and adopt it for l4 )
Also bundle is a l3 specific type and in l4 we have packages.
Ok, you can't execute composer commands on windows command prompt. mac/linux terminal would do but if you insist on using windows then install this [https://www.cygwin.com/] so you could issue unix commands

Categories