Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Composer RuntimeException - Could not load package mews/purifier [duplicate]

Tags:

I have previously installed mews/purifier package and it was working fine. Now I want to update packages using composer update, this is where 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.*"

I already checked the package list and it has this package https://packagist.org/packages/mews/purifier

I tried to remove it from composer.json by removing this line:

"mews/purifier": "^3.2",

But the error persists. I also removed associated lines in the app.php file.

'providers' => [
Mews\Purifier\PurifierServiceProvider::class
],
'aliases' => [
'Purifier' => Mews\Purifier\Facades\Purifier::class
]

I really don't know what the problem is here. It all began when I wanted to install a package and I realized this issue.

like image 846
Mahsa Avatar asked Sep 12 '20 16:09

Mahsa


1 Answers

Using this command solved the problem:

composer self-update

or if you don't have the permission:

sudo composer self-update
like image 177
Mahsa Avatar answered Oct 05 '22 05:10

Mahsa