You must install peer dependencies yourself
You must install peer dependencies yourself
I tried to run a project downloaded from github. Unfortunately, during npm install the following warnings were shown. I tried to change the version based on this question. However, I had a problem, because some packages require multiple versions other packages. Consider these two lines:
So, installing some packages causes the list of dependencies to grow substantially.
Does anyone have a solution?
Here are the contents of package.json :
ng serve returns(I pasted only the beginning and the end):
17 Answers 17
Trending sort
Trending sort is based off of the default sorting method — by highest score — but it boosts votes that have happened recently, helping to surface more up-to-date answers.
It falls back to sorting by highest score if no posts are trending.
Switch to Trending sort
«A requires a peer of B but none was installed». Consider it as «A requires one of B’s peers but that peer was not installed and we’re not telling you which of B’s peers you need.»
The automatic installation of peer dependencies was explicitly removed with npm 3.
So you cannot install peer dependencies automatically with npm 3 and upwards.
Updated Solution:
Use following for each peer dependency to install that and remove the error
Deprecated Solution:
You can use npm-install-peers to find and install required peer dependencies.
How do I deal with installing peer dependencies in Angular CLI?
I’ve found myself in an almost endless cycle of errors when trying to update my Angular CLI and NPM. Every time I update, I am met with WARN messages telling me to install peer dependencies (see below), but each time I install a dependency, I am met with more WARN messages. Is there a better way of handling this situation or does it seriously take hours?
I know I must be doing something wrong, but I’m new to Angular.
5 Answers 5
Trending sort
Trending sort is based off of the default sorting method — by highest score — but it boosts votes that have happened recently, helping to surface more up-to-date answers.
It falls back to sorting by highest score if no posts are trending.
Switch to Trending sort
Peer dependency warnings, more often than not, can be ignored. The only time you will want to take action is if the peer dependency is missing entirely, or if the version of a peer dependency is higher than the version you have installed.
Let’s take this warning as an example:
npm WARN @angular/animations@5.2.1 requires a peer of @angular/core@5.2.1 but none is installed. You must install peer dependencies yourself.
With Angular, you would like the versions you are using to be consistent across all packages. If there are any incompatible versions, change the versions in your package.json, and run npm install so they are all synced up. I tend to keep my versions for Angular at the latest version, but you will need to make sure your versions are consistent for whatever version of Angular you require (which may not be the most recent).
In a situation like this:
npm WARN ngx-carousel@1.3.5 requires a peer of @angular/core@^2.4.0 || ^4.0.0 but none is installed. You must install peer dependencies yourself.
In this situation:
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted <"os":"darwin","arch":"any">(current: <"os":"win32","arch":"x64">)
You are running Windows, and fsevent requires OSX. This warning can be ignored.
Hope this helps, and have fun learning Angular!
Install fail: npm WARN react-ga@2.5.6 requires a peer of prop-types@^15.6.0 but none is installed. You must install peer dependencies yourself. #2456
Comments
anhhai2810 commented Dec 10, 2018
Informations
What is the current behavior?
Steps to reproduce the problem
⏳ Testing database connection.
The app has been connected to the database successfully!
👌 Your new application videos is ready at D:\Strapi\videos.
⚡️ Change directory:
$ cd videos
⚡️ Start application:
$ strapi start
$ strapi start
internal/modules/cjs/loader.js:582
throw err;
^
Error: Cannot find module ‘lodash’
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:580:15)
at Function.Module._load (internal/modules/cjs/loader.js:506:25)
at Module.require (internal/modules/cjs/loader.js:636:17)
at require (internal/modules/cjs/helpers.js:20:18)
at Object. (D:\Strapi\videos\admin\controllers\Admin.js:5:11)
at Module._compile (internal/modules/cjs/loader.js:688:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
at Module.load (internal/modules/cjs/loader.js:598:32)
at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
at Function.Module._load (internal/modules/cjs/loader.js:529:3)
What is the expected behavior?
Suggested solutions
The text was updated successfully, but these errors were encountered:
npm WARN newman-reporter-html@1.0.2 requires a peer of newman@4 but none is installed. You must install peer dependencies yourself. #33
Comments
ssr240 commented Oct 30, 2018
I notice this error and reports are not generated. Here are the versions I have
The text was updated successfully, but these errors were encountered:
vgadolin commented Nov 6, 2018
I am having the same issue. Any idea on when this can be resolved?
ssr240 commented Nov 6, 2018
No idea, I am waiting for someone to help me to resolve it. The only thing I can think of is to uninstall everything and re-install all those packages.
codenirvana commented Nov 7, 2018
@ssr240 @vgadolin as mentioned in #10 (comment), you can ignore this warning.
Just make sure that installation should be global if Newman is installed globally, local otherwise.
Are you using Newman as a library, or via the CLI? Also, share the command/script used to run Newman.
vgadolin commented Nov 7, 2018
codenirvana commented Nov 8, 2018
@ssr240 Are you facing any other issue while using the reporter?
ssr240 commented Nov 8, 2018
ssr240 commented Nov 8, 2018
vgadolin commented Nov 8, 2018
Here is the command in the batch script we are using:
I hope this helps you.
ssr240 commented Nov 9, 2018
codenirvana commented Nov 12, 2018
ssr240 commented Dec 5, 2018
I was able to resolve this by updating powershell to latest version. Looks like html reports are not generated with powershell 4.0
Footer
© 2022 GitHub, Inc.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
ajv@^6.0.0 is missing #9691
Comments
KieraDOG commented Feb 20, 2018 •
npm WARN ajv-keywords@3.1.0 requires a peer of ajv@^6.0.0 but none is installed. You must install peer dependencies yourself.
Versions
Repro steps
npm WARN ajv-keywords@3.1.0 requires a peer of ajv@^6.0.0 but none is installed. You must install peer dependencies yourself.
Observed behavior
Desired behavior
angular installed without any error or warning
Mention any other details that might be useful (optional)
The text was updated successfully, but these errors were encountered:
agllai commented Feb 20, 2018
me too have the same problem
and when i tried to install ajv with the command :npm install ajv i get this
npm WARN saveError ENOENT: no such file or directory, open ‘C:\WINDOWS\system32\package.json’
npm WARN enoent ENOENT: no such file or directory, open ‘C:\WINDOWS\system32\package.json’
npm WARN system32 No description
npm WARN system32 No repository field.
npm WARN system32 No README data
npm WARN system32 No license field.
Yisus17 commented Feb 20, 2018
KellyR-STCU commented Feb 21, 2018
I am also seeing this
AianaM commented Feb 21, 2018 •
npm WARN ajv-keywords@3.1.0 requires a peer of ajv@^6.0.0 but none is installed. You must install peer dependencies yourself.
$ npm i ajv
and when I install something, it always remove flex-layout)
timbilt commented Feb 21, 2018
zaszlo commented Feb 21, 2018 •
same here, a simple fix after the npm hints doesn’t work out:
tx8821 commented Feb 21, 2018
Same issue. Please fix! @angular/cli@1.7.0
npm ERR! peer dep missing: ajv@^6.0.0, required by ajv-keywords@3.1.0
npm ERR! peer dep missing: ajv@^6.0.0, required by ajv-keywords@3.1.0
Installing ajv@6.0.0 does NOT help.
filipesilva commented Feb 21, 2018
Heya I’ve been looking at this problem and I’m not too sure what to make of it.
At the moment I think this is a npm bug.
I’m not looking at ways to alleviate the problem on Angular CLI itself.
anabelle commented Feb 21, 2018
I’ve solved it by deleting my package-lock.json and running npm install again.
timbilt commented Feb 21, 2018
Run this command just for reference:
Now for the fix, run this:
This will in allow the ajv-keywords package to resolve its peer dependencies AND also patch up any packages in subdirectories that depend on a version of ajv (ie. it installs ajv@5.5.2 for packages that need ajv@