缺少对等项依赖 [英] Missing peer dependencies
问题描述
我是 npm
和angular项目的新手,并且在我的 package.json
中使用了 bootstrap@4.1.1
.当我执行npm install时,出现以下错误-
I am new to npm
and angular projects, and I am using bootstrap@4.1.1
in my package.json
. When I do npm install, I get the following error -
bootstrap@4.1.1 requires a peer of jquery@1.9.1 - 3 but none is installed. You must install peer dependencies yourself.
这是否意味着我需要在 peerDependencies
部分下的 package.json
中添加 jquery@1.9.1-3
使用 no-save
选项在本地安装它?
Does this mean that I need to add jquery@1.9.1 - 3
to my package.json
under peerDependencies
section, apart from installing it locally with no-save
option?
此外,我们是否还需要在构建服务器上安装这种缺少的对等项依赖关系?还是可以忽略它?
Also, do we need to install this missing peer dependency on the build server as well? Or can it be ignored?
推荐答案
只需自己安装依赖项:
npm install jquery@1.9.1 --save
尽管-save
是可选的,但我建议您放置它,因此,下次您只需键入 npm install
,就会同时安装bootstrap和jquery.您可以在npm 文档上了解对等方依赖.
Although --save
is optional I recommend to put it, so the next time you simply can type only npm install
and both bootstrap and jquery will be installed. You can read about peer dependencies on npm documentation.
这篇关于缺少对等项依赖的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!