3

I am trying to install bootstrap using npm. I ran:

npm install angular-ui-bootstrap

And that succesfully installed the module in the node_modules folder. The problem is I can't seem to reference the files from index.html. I put in the following line:

<script src="/node_modules/angular-ui-bootstrap/dist/ui-bootstrap.js"></script>

But it returns a 404. I have 3 questions:

  1. Am I referencing the right file
  2. How do I include the file in index.html
  3. If I include the file in the html, will that be enough to erase another error I'm getting:

    Error: [$injector:modulerr] Failed to instantiate module ui.bootstrap due to:
    Error: [$injector:nomod] Module 'ui.bootstrap' is not available!
    

Here is the file structure:

Project
    -app
        -index.html
    -node_modules
        -angular-ui-bootstrap
            -dist
                -ui-bootstrap.js
Philip7899
  • 4,599
  • 4
  • 55
  • 114

1 Answers1

1

Just remove / from <script src="/node_modules/angular-ui-bootstrap/dist/ui-bootstrap.js"></script> Like this:

<script src="node_modules/angular-ui-bootstrap/dist/ui-bootstrap.js"></script>
Kiknaio
  • 76
  • 2
  • 9