dev27
dev27

Reputation: 605

Missing peer dependencies

I am new to npm and angular projects, and I am using [email protected] in my package.json. When I do npm install, I get the following error -

[email protected] requires a peer of [email protected] - 3 but none is installed. You must install peer dependencies yourself. 

Does this mean that I need to add [email protected] - 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?

Upvotes: 34

Views: 49250

Answers (3)

Jpsy
Jpsy

Reputation: 20882

In addition to the given answers:
If npm warns you about a missing dependency with a version range like 1.9.1 - 3 then you should definitely use that range to manually install the dependency – and not only its lower boundary. Use quotes for the range to work as a parameter in the install command. Both of the following examples will work:

npm install jquery@"1.9.1 - 3"
npm install "[email protected] - 3"

Also the parameter --save can be omitted as of npm v5.0. This is the default now when you install.

Upvotes: 1

Pramod Dissanayake
Pramod Dissanayake

Reputation: 141

You should read the terminal whether all important dependencies have been installed. If it hasn't install those manually.

npm install <MISSING DEPENDANCY> --save

In your case

npm install [email protected] --save

Upvotes: 3

4ndt3s
4ndt3s

Reputation: 3467

Simply install the dependency yourself:

npm install [email protected] --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.

Upvotes: 53

Related Questions