Purifier
Purifier copied to clipboard
Could not load package mews/purifier in http://repo.packagist.org:
Since a few hours I have problems with package and tried in laravel 7 but I get this error
[RuntimeException] Could not load package mews/purifier in http://repo.packagist.org: [UnexpectedValueException] Could not parse version constraint ~4.: Invalid version string "~4."
[UnexpectedValueException] Could not parse version constraint ~4.: Invalid version string "~4."
same
same problem here
Running composer self-update fixed the problem for me.
Thanks jeremyjaymes it worked
same
same issue
same here too
Does anyone understand what the issue is and why updating composer fixes it? Is it some composer.json file change that is only present in newer versions?
Running composer self-update fixed the problem for me.
work like a charm thanks!
Running composer self-update fixed the problem for me.
Can confirm that this solution works.
For those who are confused. Run the following command, then run composer update
$ composer self-update && composer update
Can also confirm the solution, but I needed to do some additional steps. This were my steps, because we have a composer installation done with the package manager of the linux sistem:
sudo apt-get remove composer
sudo php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
sudo php -r "if (hash_file('sha384', 'composer-setup.php') === '8a6138e2a05a8c28539c9f0fb361159823655d7ad2deecb371b04a83966c61223adc522b0189079e3e9e277cd72b8897') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
sudo php composer-setup.php
sudo php -r "unlink('composer-setup.php');"
sudo mv composer.phar /usr/local/bin/composer
I would really like to know the underlying problem as we have quite a few automated updates on hold now so that we don't have offline sites.
same issue, composer self-update
does not fix it.
recently i have also discovered issues with packagist and changed to a mirror.
switch to mirror:
composer config -g repos.packagist composer https://packagist.fi
composer.json:
"repositories": [
{
"type": "composer",
"url": "https://packagist.fi"
},
{
"packagist": false
}
],
switch back to official:
composer config -g repos.packagist composer https:/repo.packagist.org
check global config:
composer config -g -l
Could not load package mews/purifier in https://packagist.fi: [UnexpectedValueException] Could not parse version constraint ~4.: Invalid version string "~4."
Solved! reinstall composer:
sudo rm -f /usr/local/bin/composer
sudo curl -s https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer
Just to confirm, switching to the correct composer
version fixed it for me too!
Same issue! :(
If you delete the vendor directory, then you can remove purifier from composer.json and run composer install
to fix the problem, although this will remove Purifier from your project.
If anyone tried self-update and got an error about self-update is not defined, remove all versions of composer.
I had one installed via apt-get and one manually with curl/wget.
Same problem here and the composer self-update didn't fix it. I'm on Laravel 6.
I was able to solve the issue by switching to the correct build of Composer instead of using the version available on my OS (Kubuntu). I had to reinstall composer manually for it, @ibeona.
First uninstall the OS-installed version (in Debian based OSes run: sudo apt remove --purge composer
) and then install the correct one from https://getcomposer.org/
EDIT: @mrbenosborne I misread your comment at first, sorry to nudge you!
@GJPhilippi i've tested composer 1.9 and composer 1.10, i'm in a docker container. I've tested by building the container with both versions but same error each time :( .
Or do i have to switch to composer 2.0 ?
@ibeona No, Composer 2.0 isn't publicly available, so you shouldn't switch to it. I use Composer version 1.10.13 2020-09-09 11:46:34
, without a Docker container and works perfectly fine. Check that you use the correct Docker container and perhaps do a pull to get the latest version of the Docker image.
@ibeona No, Composer 2.0 isn't publicly available, so you shouldn't switch to it. I use
Composer version 1.10.13 2020-09-09 11:46:34
, without a Docker container and works perfectly fine.
Ok, i tried with composer 1.10.13 in docker tag still not working but i'll investigate and search about docker issue so ! Thank you for your time!