Why does Bootstrap give the error ‘Uncaught Error: Bootstrap’s JavaScript requires jQuery’?

Solution 1: Correct Script Order

Bootstrap depends on jQuery, so you must load jQuery first, then Bootstrap:


<script src="js/jquery-1.11.0.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/wow.min.js"></script>

Solution 2: Node/CommonJS Environment

In environments like Electron or Node-webkit, jQuery may not automatically assign itself to window.

To fix this, assign it manually:


<script>
    window.jQuery = window.$ = require('jquery');
</script>

If your Electron app does not need nodeIntegration, set it to false to avoid this workaround.

Solution 3: Example Full HTML with Correct Script Order


<!doctype html>
<html>
    <head>
        <link type="text/css" rel="stylesheet" href="css/animate.css">
        <link type="text/css" rel="stylesheet" href="css/bootstrap-theme.min.css">
        <link type="text/css" rel="stylesheet" href="css/bootstrap.min.css">
        <link type="text/css" rel="stylesheet" href="css/custom.css">

        <!-- Load scripts in proper order -->
        <script src="js/jquery-1.11.0.min.js"></script>
        <script src="js/bootstrap.min.js"></script>
        <script src="js/wow.min.js"></script>

        <title>pyMeLy Interface</title>
    </head>
    <body>
        <p class="title1"><strong>pyMeLy</strong></p>
        <p class="title2"><em>A stylish way to view your media</em></p>

        <div style="text-align:center;">
            <button type="button" class="btn btn-primary">Movies</button>
            <button type="button" class="btn btn-primary btn-lg">Large button</button>
        </div>
    </body>
</html>