Laravel Vendor\bin files are empty - php

everyone, I've been working on my project, and then I needed to install extra package on laravel, so when I tried so, I got an error, and then I discovered that files in vendor\bin directory are empty, I don't really know why so, but does anybody have any idea how to recover it, or what I have to do?
screen

Delete the composer package lock file, and then a simple
composer install would work.

Related

Composer MPDF Upgrade doesn't actually do anything

I just upgraded to PHP 7.4 and encountered the curly braces problem with a number of third party PHP applications. It was easy enough to upgrade them until I hit MPDF which was installed using Composer.
I've spend a day on it so far and I've finally reached the point where if I run ...
composer.phar require mpdf/mpdf dev-php8-support
Composer says it's upgraded MPDF, but the curly braces error has not been fixed and investigation shows that in actuality, none of the files in the /vendor/mpdf/mdpf folder have changed.
Composer appears to have done nothing.
I've run out of ideas as to how to get this to work.
While the official MPDF page has an installation guide it doesn't even even mention upgrading.
Does anyone have any clues as to what might be going ? ... or perhaps even better - how to just download and replace the PHP files? (which would be infinitely simpler than messing around with an intermediate software package just to copy a few files onto a server)
EDIT: Just to prove that composer isn't actually doing anything I deleted the /vendor/mpdf folder and ran
composer.phar require mpdf/mpdf
again and a new /vendor/mpdf folder wasn't created.
Solution:
Reinstall Composer
Completely Uninstall MPDF
Re-install MPDF
oh and ...
Pray that I never have to upgrade anything via Composer again.

Composer Installation Error asking to remove from system path

composer error
I am getting error while trying to install Composer.
The error is
Remove from the System path: c:\windows\system32.
Please help me in finding the solution.
same here but, trying to uninstall/reinstall composer but after uninstallation and clicking the composer installer i had the same prob..
I got the installer FIXED after a computer restart so that the uninstall will be complete and "system variables" will be updated.
I do not know what the problem is, but I ran into the same problem. On a hunch, I tried reinstalling composer again. When asked to choose the PhP engine, I chose PhP 5.6, which I understand is still available on all wampp / xampp installations.
That seemed to do the trick. Why 5.6 is working but 7.3 is not working I have no idea. Furthermore, I feel there is a better solution to this. Unfortunately I don't know it, but at least you can get working if that is the right solution for you.
Open CMD as Administrator type: where composer
It will show where your global composer file is.
"Remove from the System path: c:\windows\system32." If this the error you will find a "composer.bat" file in that directory. Delete that file and run installation again. Hope this fix your problem. Cheers :)
i have the same problem
i resolve by
delete php.exe in c:\windows\system32

How to copy vendor folder without having not found problem

I am using composer for my project and the entire project (even the vendor folder) is under git version control.
I know it may seem like a false action but I am in bandwidth deficit and I want to lower my bandwidth usage so I use this method to just copy the vendor folder.
When I push to to another repository and try to run php main.php from there It says that can not find the classes that I am using there.
I have managed to solve this problem by removing the whole vendor folder and re running composer i but it is not the behavior that I want. I want low bandwidth usage, I want to not wait for package installation.
I am using the same method for virtualenv of python apps and there is the same problem but that problem can be solved by just running virtualenv venv/ again so it corrects the new paths for the copied environment. How can I achieve the same behavior with composer? I dont see any info or command that can help me doing this.
Thanks in advance folks :)
Found the solution.
All you need to do is to remove one file and one folder:
rm -rf vendor/composer;
rm vendor/autoload.php;
Then run composer i and it will recreate the removed composer folder again and corrects the autoload files.
Have a nice day.

Laravel setup project file fails

I've searched many answers to this problem, and a alternative solution to this project to still get what I try to achieve, but I want to know why it is not working the 'regular' way, and if it is possible to fix it somehow. I checked out this post where I found my alternative solution.
I installed laravel and I'm trying to create a project with laravel. However, when I run this command
composer create-project laravel/laravel cms
I get the following error: [InvalidArgumentException] - Composer could not find the config file
I followed all installation settings via a tutorial, created the composer enviroment variable, so those settings should be correct. Does somebody know why this is not working and how I might be able to fix this?
Edit: To clarify, as Joe commented, composer commands do work.
first, run the following command:
composer global require "laravel/installer=~1.1"
then, add ~/.composer/vendor/bin to your PATH. this way your system knows where the laravel installer is.
When this is done, you can simple use the following command to make a new project:
composer create-project laravel/laravel --prefer-dist
I had this problem myself since i was used to use composer to init a laravel project. However, after setting up this installer, i honestly love it. It has a bunch of neat options you can use ;-)
For more info, look here

Laravel 4 /Composer Install Error

I was following a noobies guide to Laravel, but sadly I am stumped on step one..
I have tried many threads relating to the same thing, but none seem to work - and I am stumped.
I have followed to the letter, this helpful video, and never diverted in any detail.
https://www.youtube.com/watch?v=JNn_tS2KpcY
For example I have changed all the required extension=php_openssl.dll's mentioned in posts such as this:
https://stackoverflow.com/questions/16940582/laravel-4-composer-error/16940691#16940691
As you might expect I am very new to coding, so I have provided images to help illustrate things I am not too sure about.
Firstly I download and install the .phar file, and my folder structure and files look like:
This is setup globally I assume? I also have the PATH variables added correctly when the installation prompts to add them.
So next I run composer in my command line, and successfully receive:
This to me, indicates Composer is installed at least?
Ok, next I make a folder in my WAMP server, and copy the contents from "Laravel-Master", which is from Laravels GIT and quick start guide:
Next I cd to the www folder and run the command:
composer create-project laravel/laravel your-project-name --prefer-dist
Things seem to go fine, and it does make a new Laravel "project-name" (if the folder is empty)
but then errors:
Composer could not find the config file: c: programdata\composer setup\bin To initialize a project, please create a composer.json file.
This is most annoying as I stick very close to the video linked above, but do not get the same results.
Thanks very much for your time.
Your Composer installation is misconfigured (or rather un-configured.) I don't know what that video says about installing Composer however I would download an installation executable here for Windows and follow the instructions.
If you have done this, great! However something got screwed up in the installation process, so you should try running the same installer again.
According to this and this, you could also try this command instead:
COMPOSER=composer.json composer create-project laravel/laravel your-project-name --prefer-dist
You would be better suited with Laravel Homestead, which already comes with everything you need to run Laravel in a Vagrant Box
http://laravel.com/docs/4.2/homestead

Categories