npm WARN bootstrap@4.2.1 requires a peer of jquery@1.9.1 - 3 but none is installed

后端 未结 10 1837
天命终不由人
天命终不由人 2021-02-03 21:11

I tried to install bootstrap in my Angular Project by

npm install --g bootstrap

but i am getting following warning

n

相关标签:
10条回答
  • 2021-02-03 21:18

    you are installing bootstrap globally .you need to first open your project file after that go to cmd and install the bootstrap and jquery because the compiler didn't understand that where we have to install. the code is for installing bootstrap and jquery is PS E:\web\Angular\Angular program\my-first-project> npm install bootstrap@3 jquery --save then it will download and check-in your package.json file its display the version of your software

    0 讨论(0)
  • 2021-02-03 21:20

    If you are using Angular, you don't need those dependencies of jquery etc. Angular is responsible for rendering and manipulating the DOM and if you’re interfering with it using jQuery, you might get some unwanted results.

    0 讨论(0)
  • 2021-02-03 21:21

    I resolved the above issue by running the npm command

    npm install --save bootstrap

    0 讨论(0)
  • 2021-02-03 21:22

    I have resolved jQuery dependency with following steps in my react development project

    npm install react-bootstrap bootstrap --save
    npm audit fix --force
    

    Result: found 0 vulnerabilities

    It also fixes the issue, if another dependency is having issues.

    0 讨论(0)
  • 2021-02-03 21:22

    just check the path where you are working:-

    $ pwd

    if you are not in your project directory then type:

    $ cd your-app

    after checking all those above things than type:

    npm install --g bootstrap

    0 讨论(0)
  • 2021-02-03 21:37

    npm installation:

    $npm install bootstrap

    $npm install bootstrap jquery popper.js --save

    then

    import to the react folder(index.js):

    import 'bootstrap';

    import 'bootstrap/dist/css/bootstrap.min.css';

    0 讨论(0)
提交回复
热议问题