2

I would like to use bootstrap 3.3.7 and 4.0.0 in same project. I tried to use the following in my package.json but it's not working:

"dependencies": {
 "bootstrap": "^3.3.7, ^4.0.0"
}

I tried the following too and that's not working too:

"dependencies": {
  "bootstrap": "^3.3.7",
  "bootstrap-4.0.0": "bootstrap#4.0.0"
}

How can i install that different version of node package?

Zsolt Janes
  • 800
  • 2
  • 8
  • 26
  • Possible duplicate of [how to install multiple versions of package using npm](https://stackoverflow.com/questions/26414587/how-to-install-multiple-versions-of-package-using-npm) – progm Sep 01 '18 at 12:01
  • Sorry but I still didn't find the commands for npm multiple bootstrap install – Zsolt Janes Sep 01 '18 at 18:44

2 Answers2

0

You could use aliases like this:

"dependencies": {
    "bootstrap": "4.0.0",
    "bootstrap3": "npm:bootstrap@3.3.7"
}
Talita
  • 805
  • 3
  • 11
  • 31
  • Not working:17 silly fetchPackageMetaData error for bootstrap3@npm:bootstrap@3.3.7 Invalid dependency type requested: alias – Zsolt Janes Mar 06 '19 at 22:59
0

If you have installed the different versions via npm, you can use them like that:

npm i bootstrap-3@npm:bootstrap-sass@\^3 bootstrap-4@npm:bootstrap@\^4 bootstrap-5@npm:bootstrap@\^5 bootstrap

And then like Talita says, you can use aliases.

package.json:

(...)
  "dependencies": {    
    "bootstrap": "latest",
    "bootstrap-3": "npm:bootstrap-sass@^3.4.1",
    "bootstrap-4": "npm:bootstrap@^4.6.0",
    "bootstrap-5": "npm:bootstrap@^5.0.1"
  },
Julian
  • 598
  • 8
  • 23