Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npm ERR! peer dep missing: ajv@^6.0.0, required by ajv-keywords@3.1.0 #708

Closed
sbwfnyiiiu opened this issue Feb 18, 2018 · 24 comments
Closed

Comments

@sbwfnyiiiu
Copy link

sbwfnyiiiu commented Feb 18, 2018

What version of Ajv are you using? Does the issue happen if you use the latest version?

Ajv options object

JSON Schema

Sample data

Your code

Validation result, data AFTER validation, error messages



What results did you expect?

Are you going to resolve the issue?
a.txt

@epoberezkin
Copy link
Member

Most likely, the issue title explains the problem. What is the output of npm ls? Try removing package-lock.json and reinstalling node_modules.

@sbwfnyiiiu
Copy link
Author

sbwfnyiiiu commented Feb 18, 2018

Hello, I have uploaded the "npm ls" output, please see the a.txt file
a.txt
. I have tried on maccOS, ununtu 16.04. and always get the same result,
...........
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

@epoberezkin
Copy link
Member

epoberezkin commented Feb 22, 2018

In your output the error is in the chain:

@angular/cli -> cache-loader -> schema-utils@0.4.5 -> ajv-keywords

schema-utils@0.4.5 depends on ajv@^6.1.0, I don't know why it was not installed (it's not in the output of npm ls).

Did you try removing everything and re-installing?
Which version of node.js you are using?
Does it change if you try older/newer version of node.js?

@sbwfnyiiiu
Copy link
Author

sbwfnyiiiu commented Feb 24, 2018

This happened when installing Angular/CLI, if downgrade the following 3 packages, seems to ok
ajv-keywords v2.1.1,
schema-utils: v0.4.3,
webpack: v0.4.3 ,
but when you run "ng new NewProject", the problem comes again, you have to manualy downgrade everytime when create new project.

@epoberezkin
Copy link
Member

git clone ... && npm install works ok for me - it doesn't show the error above.
If an issue happens during ng new NewProject I think it should be reported to @angular/cli.
Closing it here.

@dputtick
Copy link

For reference, I think this might be an npm bug - seeing this problem with npm@5.3.0 and npm@3.10.10, but not with npm@5.6.0 or npm@2.15.11.

@jafin
Copy link

jafin commented Mar 4, 2018

@dputtick thanks, was on NPM 5.5.1 receiving this error, moving to npm@5.6.0 removed the ajv-keywords WARN.

EDIT: Sorry must of been in placebo land, still happening. 👎

@JACrazy
Copy link

JACrazy commented Mar 5, 2018

@dputtick Weird, I still get the WARN on npm@5.6.0 and I even updated to npm@5.7.1 and still get it.

@bilegochir
Copy link

same error for node 8.9.4 and npm 5.7.1

@kurniawanw0194
Copy link

Same error for node 9.8.0 and npm 5.7.1

@WraithKenny
Copy link

...
│ ├── UNMET PEER DEPENDENCY ajv@6.2.1
│ ├── ajv-keywords@3.1.0
...
npm ERR! peer dep missing: ajv@^6.0.0, required by ajv-keywords@3.1.0

@WraithKenny
Copy link

This is fixed by adding ajv in your project. The problem is almost certainly with npm itself.

@silencieuxle
Copy link

Is the ajv required by every package? Cause I'm using react and everytime I install any package it tell me that ajv-keywords requires ajv to be installed. Annoying!!!!!

@eholland7080
Copy link

eholland7080 commented Mar 25, 2018

Hello everyone, if you are experiencing this issue (npm ERR! peer dep missing: ajv@^6.0.0, required by ajv-keywords@3.1.0) after using create-react-app and trying to npm install any package, it is because ajv-keywords has devDependencies and peerDependencies on ajv ^6.0.0, but what is installed (assuming as part of the create-react-app process) is ajv 5.5.2. So "A" way to resolve (work around) is to change those two lines in the ajv-keywords package.json from 6.0.0 to 5.5.2. I did that and now I can npm install any package in my create-react-app . Hope this helps...

@epoberezkin
Copy link
Member

@eholland7080 the correct way to resolve it is to either upgrade ajv to 6.x or downgrade ajv-keywords to 2.x, as otherwise they are not fully compatible (even if they can work in some cases). I wonder what tool has ajv 5.x and ajv-keywords 3.x in its dependencies. Can it be caused by eslint still using 5.x and webpack using 6.x (and ajv-keywords 3.x)? If so, it's definitely npm issue, although can be fixed by upgrading eslint...

@eholland7080
Copy link

@epoberezkin thank you! how would you recommend as to the best way to upgrade ajv to 6.x? I understand how I would do it if I had installed ajv myself using npm install. not sure how I should do it if ajv was installed automatically by a tool like react-create-app. learning a lot but still a little new so any direction / instructions you can give would be greatly appreciated. thank you...

@eholland7080
Copy link

@silencieuxle are you still seeing this issue when using react? if you're not, what did you do to fix?

@eholland7080
Copy link

We suggest that you begin by typing:

cd my-app
npm start

Happy hacking!
Erics-MacBook-Pro:prototype ericholland$ cd my-app/
Erics-MacBook-Pro:my-app ericholland$ npm list --depth 0
my-app@0.1.0 /Users/ericholland/Documents/work/development/react/prototype/my-app
├── react@16.3.0
├── react-dom@16.3.0
└── react-scripts@1.1.1

npm ERR! peer dep missing: ajv@^6.0.0, required by ajv-keywords@3.1.0
Erics-MacBook-Pro:my-app ericholland$

@epoberezkin
Copy link
Member

See the second part of the answer in eslint/eslint#9856 (comment)

According to it it’s an npm bug.

@platinumazure
Copy link
Contributor

Found the npm issue: npm/npm#19877 (specifically this comment). Hope this helps!

@eholland7080
Copy link

@epoberezkin thank you! thats good information there. based on those comments looks like it is a problem with npm 3+ ? so not sure what to do in the interim between now and when the npm folks fix the issue.

@epoberezkin
Copy link
Member

@eholland7080 is it a blocking issue? Can't you just use some command line parameter to ignore the message? I'm not sure npm is going to fix it any time soon...

@eholland7080
Copy link

@epoberezkin using yarn now and the specific issue above does not occur.
thank you
Eric

@AnwarMEQOR
Copy link

I was having the same issue with Angular 14 (project generated with ng new).
Upgrading npm solved the problem: npm install npm@latest -g

kpsherva added a commit to kpsherva/react-invenio-forms that referenced this issue Mar 3, 2023
* add ajv due to npm resolution issues
  ajv-validator/ajv#708
kpsherva added a commit to kpsherva/react-invenio-forms that referenced this issue Mar 3, 2023
* add ajv due to npm resolution issues
  ajv-validator/ajv#708
kpsherva added a commit to kpsherva/react-invenio-forms that referenced this issue Mar 3, 2023
* add ajv due to npm resolution issues
  ajv-validator/ajv#708
kpsherva added a commit to kpsherva/react-invenio-forms that referenced this issue Mar 3, 2023
* add ajv due to npm resolution issues
  ajv-validator/ajv#708
kpsherva added a commit to kpsherva/react-invenio-forms that referenced this issue Mar 3, 2023
* add ajv due to npm resolution issues
  ajv-validator/ajv#708
kpsherva added a commit to kpsherva/react-invenio-forms that referenced this issue Mar 3, 2023
* add ajv due to npm resolution issues
  ajv-validator/ajv#708
kpsherva added a commit to inveniosoftware/react-invenio-forms that referenced this issue Mar 3, 2023
* add ajv due to npm resolution issues
  ajv-validator/ajv#708
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests