Twitter 引导程序未在 Laravel 4 中使用 Composer 进行安装

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/17394219/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 08:03:52  来源:igfitidea点击:

Twitter bootstrap not installing using composer in laravel 4

phptwitter-bootstraplaravellaravel-4composer-php

提问by user61629

I am working on the following tutorial:

我正在研究以下教程:

http://net.tutsplus.com/tutorials/javascript-ajax/combining-laravel-4-and-backbone/

following this my composer.json filehas the following:

在此之后,我的 composer.json 文件具有以下内容:

{
  "require": {
    "laravel/framework": "4.0.*",
    "way/generators": "dev-master",
    "twitter/bootstrap": "dev-master",
    "conarwelsh/mustache-l4": "dev-master"
  },
  "require-dev": {
    "phpunit/phpunit": "3.7.*",
    "mockery/mockery": "0.7.*"
  },
  "autoload": {
    "classmap": [
      "app/commands",
      "app/controllers",
      "app/models",
      "app/database/migrations",
      "app/database/seeds",
      "app/tests/TestCase.php"
    ]
  },
  "scripts": {
    "post-update-cmd": "php artisan optimize"
  },
  "minimum-stability": "dev"
}

I run composer to install the dependencies

我运行 composer 来安装依赖项

$ composer install --dev

If I then go into the vendor folder there is no twitter-bootstrap folder. ( The other dependencies appear to have been installed.

如果我然后进入供应商文件夹,则没有 twitter-bootstrap 文件夹。(其他依赖项似乎已安装。

when I run update:

当我运行更新时:

$ composer update --dev
Loading composer repositories with package information
Updating dependencies (including require-dev)
- Removing symfony/console (2.3.x-dev 35da735)
- Installing symfony/console (2.3.x-dev 911cdac)
Downloading: 100%

Writing lock file
Generating autoload files
Generating optimized class loader
Compiling common classes

-- No errors, the bootstrap files are not in the vendor folder

-- 没有错误,引导文件不在供应商文件夹中

Has anyone run into this problem. Is there any way to fix it?

有没有人遇到过这个问题。有什么办法可以解决吗?

回答by Arthur BALAGNE

composer require "twitter/bootstrap":"*"
Worked fine for me

composer require "twitter/bootstrap":"*"
对我来说很好用

回答by Andreas

The above solution doesn't seem to work anymore, I had to add another package inside my composer.json which pointed to the existing bootstrap repository (https://github.com/twbs/bootstrap)

上面的解决方案似乎不再起作用,我不得不在我的 composer.json 中添加另一个指向现有引导程序存储库的包(https://github.com/twbs/bootstrap

Below is a partialcomposer.json that works for me.

下面是对我有用的部分composer.json。

"repositories": [
    {
        "type": "package",
        "package": {
            "version": "3.0.0",
            "name": "twbs/bootstrap",
            "source": {
                "url": "https://github.com/twbs/bootstrap.git",
                "type": "git",
                "reference": "master"
            },
            "dist": {
                "url": "https://github.com/twbs/bootstrap/zipball/master",
                "type": "zip"
            }
        }
    }
],
"require": {
    "laravel/framework": "4.0.*",
    "twbs/bootstrap": "*"
},

回答by Emeka Mbah

You need to update composer.phar

您需要更新 composer.phar

Run composer self-updateto update composer.phar then after you need to run

运行composer selfupdate来更新 composer.phar 然后在你需要运行之后

composer updateto install twitter bootstrap

作曲家更新以安装 Twitter 引导程序