Mauro
Mauro

Reputation: 2555

jenssegers/mongodb dependecies issues with Laravel Sail - ext-mongodb

I'm trying to setup MongoDB in a Laravel Jetstream + Sail.

What I'm doing is trying to install the following packages:

but I get the following errors :

 Problem 1
- jenssegers/mongodb[v3.8.0, ..., v3.8.2] require mongodb/mongodb ^1.6 -> satisfiable by mongodb/mongodb[1.6.0, ..., 1.9.x-dev (alias of dev-master)].
- mongodb/mongodb 1.9.x-dev is an alias of mongodb/mongodb dev-master and thus requires it to be installed too.
- mongodb/mongodb dev-master requires ext-mongodb ^1.10.0 -> it is missing from your system. Install or enable PHP's mongodb extension.
- mongodb/mongodb[1.6.0, ..., v1.6.x-dev] require php ^5.6 || ^7.0 -> your php version (8.0.2) does not satisfy that requirement.
- mongodb/mongodb[1.7.0-beta1, ..., v1.7.x-dev] require php ^7.0 -> your php version (8.0.2) does not satisfy that requirement.
- mongodb/mongodb[1.8.0-RC1, ..., v1.8.x-dev] require ext-mongodb ^1.8.1 -> it is missing from your system. Install or enable PHP's mongodb extension.
- Root composer.json requires jenssegers/mongodb ^3.8 -> satisfiable by jenssegers/mongodb[v3.8.0, v3.8.1, v3.8.2].

like suggested in this: Why does composer complain about the ext-mongo extension?

I added to my composer.json the following

"provide" : {
    "ext-mongo": "*"
},

But nothing changed, I also tried adding the package:

"soyuka/stubs-mongodb": "^1.0",

But same problems.

Thanks Mauro

Upvotes: 0

Views: 887

Answers (1)

Mauro
Mauro

Reputation: 2555

The solution was to publish Sail docker files and add:

php8.0-mongodb

in /docker/8.0/DockerFile

Building and running:

sail composer require jenssegers/mongodb

Upvotes: 1

Related Questions