0
votes

I need a Laravel framework expert to help me figure out what happened to my configuration composer.json. Or maybe I'm doing something wrong when installing the bootstrap 4 package. Or maybe something is wrong with package.json ?

First I update composer and install bootstrap:

npm install bootstrap

checking the package.json in which bootstrap 4.4.1 appeared:

{
    "private": true,
    "scripts": {
        "dev": "npm run development",
        "development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
        "watch": "npm run development -- --watch",
        "watch-poll": "npm run watch -- --watch-poll",
        "hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
        "prod": "npm run production",
        "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
    },
    "devDependencies": {
        "axios": "^0.19",
        "cross-env": "^5.1",
        "laravel-mix": "^4.0.7",
        "lodash": "^4.17.13",
        "resolve-url-loader": "^2.3.1",
        "sass": "^1.15.2",
        "sass-loader": "^7.1.0",
        "vue-template-compiler": "^2.6.11"
    },
    "dependencies": {
        "bootstrap": "^4.4.1",
        "express": "^4.17.1",
        "fs": "0.0.1-security",
        "module": "^1.2.5",
        "vue": "^2.6.11",
        "vue-infinite-scroll": "^2.0.2",
        "vue-loader": "^15.8.3",
        "vue-meta": "^2.3.1",
        "vue-router": "^3.1.3",
        "vue-server-renderer": "^2.6.11",
        "vue-yandex-maps": "^0.10.4",
        "vue2-google-maps": "^0.10.7"
    }
}

composer.json:

{
    "name": "laravel/laravel",
    "type": "project",
    "description": "The Laravel Framework.",
    "keywords": [
        "framework",
        "laravel"
    ],
    "license": "MIT",
    "require": {
        "php": "^7.2",
        "fideloper/proxy": "^4.0",
        "laravel/framework": "^6.2",
        "laravel/tinker": "^2.0"
    },
    "require-dev": {
        "facade/ignition": "^1.4",
        "fzaninotto/faker": "^1.4",
        "mockery/mockery": "^1.0",
        "nunomaduro/collision": "^3.0",
        "phpunit/phpunit": "^8.0"
    },
    "config": {
        "optimize-autoloader": true,
        "preferred-install": "dist",
        "sort-packages": true
    },
    "extra": {
        "laravel": {
            "dont-discover": []
        }
    },
    "autoload": {
        "psr-4": {
            "App\\": "app/"
        },
        "classmap": [
            "database/seeds",
            "database/factories"
        ]
    },
    "autoload-dev": {
        "psr-4": {
            "Tests\\": "tests/"
        }
    },
    "minimum-stability": "dev",
    "prefer-stable": true,
    "scripts": {
        "post-autoload-dump": [
            "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
            "@php artisan package:discover --ansi"
        ],
        "post-root-package-install": [
            "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "@php artisan key:generate --ansi"
        ]
    }
}

next, I try to produce the command php composer.phar require laravel/ui but I get an error:

Problem 1
    - Conclusion: remove laravel/framework v6.18.2
    - Conclusion: don't install laravel/framework v6.18.2
    - laravel/ui 2.x-dev requires illuminate/support ^7.0 -> satisfiable by laravel/framework[7.x-dev], illuminate/support[7.x-dev, v7.0.0, v7.0.1, v7.0.2, v7.0.3, v7.0.4, v7.0.5, v7.0.6, v7.0.7, v7.0.8, v7.1.0, v7.1.1, v7.1.2, v7.1.3, v7.2.0, v7.2.1, v7.2.2].
    - laravel/ui v2.0.0 requires illuminate/support ^7.0 -> satisfiable by laravel/framework[7.x-dev], illuminate/support[7.x-dev, v7.0.0, v7.0.1, v7.0.2, v7.0.3, v7.0.4, v7.0.5, v7.0.6, v7.0.7, v7.0.8, v7.1.0, v7.1.1, v7.1.2, v7.1.3, v7.2.0, v7.2.1, v7.2.2].
    - laravel/ui v2.0.1 requires illuminate/support ^7.0 -> satisfiable by laravel/framework[7.x-dev], illuminate/support[7.x-dev, v7.0.0, v7.0.1, v7.0.2, v7.0.3, v7.0.4, v7.0.5, v7.0.6, v7.0.7, v7.0.8, v7.1.0, v7.1.1, v7.1.2, v7.1.3, v7.2.0, v7.2.1, v7.2.2].
    - Can only install one of: laravel/framework[7.x-dev, v6.18.2].

    ........

    - Installation request for laravel/framework (locked at v6.18.2, required as ^6.2) -> satisfiable by laravel/framework[v6.18.2].
    - Installation request for laravel/ui ^2.0 -> satisfiable by laravel/ui[2.x-dev, v2.0.0, v2.0.1].

What should I do to make bootstrap work in Laravel 6.18.2 ?

1

1 Answers

0
votes

When you are installing laravel/ui, it's attempting to install the version 2.x which requires Laravel 7.

You can use the following command to install it for Laravel 6.x:

composer require laravel/ui:^1.0 --dev

For more information: https://laravel.com/docs/6.x/frontend#introduction