Home > Enterprise >  How to install bootstrap to angular
How to install bootstrap to angular

Time:01-07

I am trying to install bootstrap to angular

This is the code I am entering: npm install bootstrap jquery --save

I then get this back:

up to date, audited 1013 packages in 3s

92 packages are looking for funding run npm fund for details

found 0 vulnerabilities

But when I try running ng serve I'm getting an error message:

An unhandled exception occurred: ENOENT: no such file or directory, lstat 'C:\Users\ Laptop\D1\node_modules\bootstap' See "C:\Users\laptop\AppData\Local\Temp\ng-uVEA31\angular-errors.log" for further details.

I'm not sure what is going wrong

CodePudding user response:

Run this npm command instead npm i angular-bootstrap

CodePudding user response:

This is among the ones used the most: https://www.npmjs.com/package/@ng-bootstrap/ng-bootstrap

CodePudding user response:

You can run the command

$ npm install bootstrap

The Bootstrap assets will be installed in the node_modules/bootstrap folder. You can include Bootstrap files from node_modules/bootstrap using the index.html file.

Open the src/index.html file and add the following tags:

A <link> tag for adding the bootstrap.css file in the <head> section. A <script> tag for adding the bootstrap.js file before the </body> tag.

<!doctype html>
<html>
<head>  
<title>Angular Bootstrap</title> 
<link rel="stylesheet" href="../node_modules/bootstrap/dist/css/bootstrap.css">
</head>
<body>  
<app-root></app-root>  
<script src="../node_modules/bootstrap/dist/js/bootstrap.js"></script>    
</body>
</html>
  •  Tags:  
  • Related