问题
I tried to install bootstrap in my Angular Project by
npm install --g bootstrap
but i am getting following warning
npm WARN bootstrap@4.2.1 requires a peer of jquery@1.9.1 - 3 but none is installed. You must install peer dependencies yourself.
npm WARN bootstrap@4.2.1 requires a peer of popper.js@^1.14.6 but none is installed. You must install peer dependencies yourself.
I am using following version of ng and npm
Angular CLI: 7.1.4
Node: 10.15.0
OS: win32 x64
Angular: 7.1.4
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router
Package Version
-----------------------------------------------------------
@angular-devkit/architect 0.11.4
@angular-devkit/build-angular 0.11.4
@angular-devkit/build-optimizer 0.11.4
@angular-devkit/build-webpack 0.11.4
@angular-devkit/core 7.1.4
@angular-devkit/schematics 7.1.4
@ngtools/webpack 7.1.4
@schematics/angular 7.1.4
@schematics/update 0.11.4
rxjs 6.3.3
typescript 3.1.6
webpack 4.23.1
回答1:
Just do as it says:
npm i jquery@1.9.1 --save
the option --save is to save this dependency to your project.
回答2:
This worked for me -
npm i -g npm@3.10.10
回答3:
I had the same problem and this is the solution:
npm install bootstrap jquery popper.js --save
The system automatically resolves the references for you.
回答4:
I resolved the above issue by running the npm command
npm install --save bootstrap
回答5:
In your package.json file search for "dependencies" and editing it to show as
"dependencies": {
//same lib
"jquery": "^1.9.1",
},
or run this command from cmd
npm i jquery@1.9.1 --save
回答6:
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.
回答7:
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
来源:https://stackoverflow.com/questions/54097328/npm-warn-bootstrap4-2-1-requires-a-peer-of-jquery1-9-1-3-but-none-is-install