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?
Peer dependencies are resolved from dependencies installed higher in the dependency graph, since they share the same version as their parent. That means that if [email protected] has two peers ( bar@^1 and baz@^1 ) then it might have multiple different sets of dependencies in the same project.
Peer dependencies are a special type of dependency that would only ever come up if you were publishing your own package. Having a peer dependency means that your package needs a dependency that is the same exact dependency as the person installing your package.
Current Behavior. When running npm install , it does not install the peer dependencies automatically even if they are in the package-lock. json file. Instead it modifies the package-lock.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With