eeeeeeve
V2EX  ›  Node.js

bower 可以同时安装两个版本的 bootstrap 么?

  •  
  •   eeeeeeve · Apr 27, 2015 · 3635 views
    This topic created in 4037 days ago, the information mentioned may be changed or developed.
    试了下,好像不行啊:(

    如何配置才能同时安装两个版本的bootstrap呢?

    {
    "name": "import_react",
    "version": "0.1",
    "authors": [
    "forest <[email protected]>";
    ],
    "moduleType": [
    "amd"
    ],
    "dependencies": {
    "bootstrap": "3.0.3",
    "bootstrap": "2.0.2"
    },
    "license": "MIT",
    "ignore": [
    "**/.*",
    "node_modules",
    "bower_components",
    "test",
    "tests"
    ]
    }
    Niphor
        1
    Niphor  
       Apr 27, 2015   ❤️ 1
    ```
    bower install <name>=<package>#<version>
    ```
    这样试试?
    eeeeeeve
        2
    eeeeeeve  
    OP
       Apr 27, 2015
    @Niphor 不行,也只能安装一个版本
    Niphor
        3
    Niphor  
       Apr 27, 2015
    @eeeeeeve 可以啊

    ```
    bower install bootstrap --save
    bower install bootstrap-v2=bootstrap#2.3.2 --save
    bower list
    bower check-new Checking for new versions of the project dependencies..
    demo#0.0.0 D:\demo
    ├─┬ bootstrap#3.3.4
    │ └── jquery#2.0.3 (2.1.3 available)
    └─┬ bootstrap-v2#2.3.2 (latest is 3.3.4)
    └── jquery#2.0.3 (latest is 2.1.3)

    ```

    bower.json
    ```
    "dependencies": {
    "bootstrap": "~3.3.4",
    "bootstrap-v2": "bootstrap#2.3.2"
    }
    ```

    不过3.3.4可以用2.1.3的jquery,你也可以再取个名字把jquery也放2个...
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3114 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 13:16 · PVG 21:16 · LAX 06:16 · JFK 09:16
    ♥ Do have faith in what you're doing.