缺少对等项依赖
收藏

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. 

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?

另外,我们是否还需要在构建服务器上安装这种缺少的对等项依赖关系?还是可以忽略?

最佳答案

只需自己安装依赖项:

npm install jquery@1.9.1 --save

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.

    公众号
    关注公众号订阅更多技术干货!