How to check your Bootstrap version

avatar
Borislav Hadzhiev

Last updated: Apr 4, 2024
2 min

banner

# How to check your Bootstrap version

You can check your Bootstrap version by opening your bootstrap.css or bootstrap.min.css file. The second line of the file contains information about which version of Bootstrap is being loaded by the file, e.g. Bootstrap v5.2.3.

check bootstrap version from min css file

bootstrap.min.css
@charset "UTF-8";/*! * Bootstrap v5.2.3 (https://getbootstrap.com/) * Copyright 2011-2022 The Bootstrap Authors * Copyright 2011-2022 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) */

The file will most likely be named bootstrap.min.css or bootstrap.css.

An alternative way to check your Bootstrap version is to use the developer tools in your browser:

  1. Press F12 to open your developer tools or right-click on the page and click Inspect.
  2. Click on the Network tab.
  3. Search for bootstrap in the search field.
  4. Click on the bootstrap.min.css file and then click on Preview.

click on bootstrap min css file in developer tools

If you installed the bootstrap package using npm, you can check your version by opening your terminal in your project's root directory (where your package.json file is) and issuing the following command.

shell
npm ls bootstrap npm ls bootstrap --depth=0
You can also check the version of your locally installed bootstrap package in the dependencies object in your package.json file.

check bootstrap version in package json

# Installing bootstrap locally

If you need to install bootstrap locally to your project, open your terminal in your project's root directory and run the following command.

shell
# ๐Ÿ‘‡๏ธ install `bootstrap` npm install bootstrap # ๐Ÿ‘‡๏ธ install the latest version of `bootstrap` npm install bootstrap@latest

If you need to get the latest version of bootstrap, use the npm view bootstrap version command.

shell
npm view bootstrap version

If you want to list all versions of the bootstrap package, use the npm view bootstrap versions command.

shell
npm view bootstrap versions npm view bootstrap versions --json

If you want to install a specific version of bootstrap, use the @ symbol to specify the version.

shell
npm install bootstrap@5.2.3 # ๐Ÿ‘‡๏ธ if you get an error npm install bootstrap@5.2.3 --legacy-peer-deps

If you need to update bootstrap to the latest version, use the following command.

shell
npm install bootstrap@latest # ๐Ÿ‘‡๏ธ if you get an error npm install bootstrap@latest --legacy-peer-deps

You can use the npm outdated command to list the current version and the latest version of your npm packages.

shell
npm outdated

You can use the npm update command to update your locally installed packages or the npm update -g command to update your globally installed NPM packages.

shell
# ๐Ÿ‘‡๏ธ update ALL locally installed packages npm update # ๐Ÿ‘‡๏ธ update ALL globally installed packages npm update -g

The npm update command follows the version constraints specified in your package.json file.

I wrote a book in which I share everything I know about how to become a better, more efficient programmer.
book cover
You can use the search field on my Home Page to filter through all of my articles.

Copyright ยฉ 2024 Borislav Hadzhiev