-1

I am trying to install the following package in my laravel app composer require 64robots/nova-fields, I am getting the error:

Problem 1
    - phpunit/phpunit is locked to version 9.5.2 and an update of this package was not requested.
    - phpunit/phpunit 9.5.2 requires ext-dom * -> it is missing from your system. Install or enable PHP's dom extension.
  Problem 2
    - tijsverkoyen/css-to-inline-styles 2.2.3 requires ext-dom * -> it is missing from your system. Install or enable PHP's dom extension.
    - laravel/framework v8.26.1 requires tijsverkoyen/css-to-inline-styles ^2.2.2 -> satisfiable by tijsverkoyen/css-to-inline-styles[2.2.3].
    - laravel/framework is locked to version v8.26.1 and an update of this package was not requested.

To enable extensions, verify that they are enabled in your .ini files:
    - /etc/php/7.4/cli/php.ini
    - /etc/php/7.4/cli/conf.d/10-opcache.ini
    - /etc/php/7.4/cli/conf.d/10-pdo.ini
    - /etc/php/7.4/cli/conf.d/20-calendar.ini
    - /etc/php/7.4/cli/conf.d/20-ctype.ini
    - /etc/php/7.4/cli/conf.d/20-exif.ini
    - /etc/php/7.4/cli/conf.d/20-ffi.ini
    - /etc/php/7.4/cli/conf.d/20-fileinfo.ini
    - /etc/php/7.4/cli/conf.d/20-ftp.ini
    - /etc/php/7.4/cli/conf.d/20-gettext.ini
    - /etc/php/7.4/cli/conf.d/20-iconv.ini
    - /etc/php/7.4/cli/conf.d/20-json.ini
    - /etc/php/7.4/cli/conf.d/20-mbstring.ini
    - /etc/php/7.4/cli/conf.d/20-phar.ini
    - /etc/php/7.4/cli/conf.d/20-posix.ini
    - /etc/php/7.4/cli/conf.d/20-readline.ini
    - /etc/php/7.4/cli/conf.d/20-shmop.ini
    - /etc/php/7.4/cli/conf.d/20-sockets.ini
    - /etc/php/7.4/cli/conf.d/20-sysvmsg.ini
    - /etc/php/7.4/cli/conf.d/20-sysvsem.ini
    - /etc/php/7.4/cli/conf.d/20-sysvshm.ini
    - /etc/php/7.4/cli/conf.d/20-tokenizer.ini

this is my Dockerfile:

FROM php:7.4
WORKDIR /app
RUN ls -la /app
RUN apt-get update && apt-get install -y git libpq-dev
RUN docker-php-ext-install pdo pdo_pgsql php-xml

here is my composer file:

 "require": {
        "php": "^7.3|^8.0",
        "64robots/nova-fields": "^0.18.0",
        "fideloper/proxy": "^4.4",
        "fruitcake/laravel-cors": "^2.0",
        "guzzlehttp/guzzle": "^7.0.1",
        "laravel/framework": "^8.12",
        "laravel/nova": "*",
        "laravel/tinker": "^2.5"
    },
    "require-dev": {
        "facade/ignition": "^2.5",
        "fakerphp/faker": "^1.9.1",
        "laravel/sail": "^1.0.1",
        "mockery/mockery": "^1.4.2",
        "nunomaduro/collision": "^5.0",
        "phpunit/phpunit": "^9.3.3"
    },
    "config": {
        "optimize-autoloader": true,
        "preferred-install": "dist",
        "sort-packages": true
    },

Im new to PHP stack - so some details in the solution will be appreceated.

Thanks

SexyMF
  • 10,657
  • 33
  • 102
  • 206

1 Answers1

-1

Your docker machine doesn't have the DOM extension loaded, you'll need to build the image again, adding some PHP modules.

RUN docker-php-ext-install dom
Machavity
  • 30,841
  • 27
  • 92
  • 100
delboy1978uk
  • 12,118
  • 2
  • 21
  • 39
  • 2
    Please don't add links to your project that are irrelevant to the answer. See [the help center promotion page](/help/promotion) – Machavity Feb 05 '21 at 13:12
  • Same error after adding `dom` – SexyMF Feb 05 '21 at 13:18
  • What do you mean by "same error"? Have you properly rebuilt and restarted the container? – Nico Haase Feb 05 '21 at 13:39
  • I did `docker-compose up --build` then it was actually really re-built, then i run the command again and I got hte same error in the decription. thanks – SexyMF Feb 05 '21 at 16:23