Install Bootstrap And Jquery

Rhed AliganRhed Aligan
2 min read

To install bootstrap the latest version automatically:

S1: Go to the terminal of your project or CMD within your project and command this

npm install bootstrap //For automatically install latest 
OR

npm install bootstrap@4.6.2 jquery popper.js // install Bootstrap, jQuery, 
                                             // and Popper.js (Bootstrap 4 needs these)

Inside of this has a file of

node_modules/bootstrap/dist/css/bootstrap.min.css
node_modules/bootstrap/dist/js/bootstrap.bundle.min.js
node_modules/jquery/dist/jquery.min.js

SO, TO AWARE BOOTSTRAP 5 as of the August 2025 doesn’t’ require of any jQuery to use but instead simple JavaScript is work fine but some of them are used and accustomed with jQuery, so you need manually install it in Bootstrap 5:

S2: Run this each line in your same terminal or CMD within your project:

npm install jquery

node_modules/jquery/dist/jquery.min.js

copy node_modules\jquery\dist\jquery.min.js assets\js\

After you do the above command, you can put this in your footer, main file, or every file (not recommended because of redundancy and repetition, understand the flow and dependency injection to reusable UI as of now) then you can put this in your file before end of </body> </html> or sample like below.


<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
<link rel="stylesheet" href="<?= base_url('assets/css/bootstrap.min.css') ?>">
</head>
<body>

<script src="<?= base_url('assets/js/jquery.min.js') ?>"></script> <!-- Here -->
<script src="<?= base_url('assets/js/bootstrap.bundle.min.js') ?>"></script> <!-- Here -->
</body>
</html>

REMINDER: YOU CAN’T RUN THE BOOTSTRAP AND JQUERY USING ONLY ABOVE HTML BIOLERPLATE, YOU NEED TO INSTALL WHAT I’VE PUT IN THE EARLY OF THE DOCUMENTS TO RUN SINCE THE URL ARE BASE ON YOUR FOLDER.

This is enough to run bootstrap in your project

To be continued.

Thank you and God bless.

0
Subscribe to my newsletter

Read articles from Rhed Aligan directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Rhed Aligan
Rhed Aligan

I'm very enthusiast in things that gives me new material to learn.