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 #4232

Closed
eholland7080 opened this issue Mar 31, 2018 · 5 comments
Closed

Comments

@eholland7080
Copy link

hello

ENVIRONMENT
macOS: high Sierra 10.13.4
node: v9.9.0
npm: v5.8.0
create-react-app: v1.5.2

STEPS TO REPRODUCE:

  1. run create-react-app my-app
  2. cd into my-app
  3. try and install any npm package or type npm list --depth 0 and see:
    Erics-MacBook-Pro:my-app2 ericholland$ npm list --depth 0
    my-app2@0.1.0 /Users/ericholland/Documents/work/development/react/prototype/my-app2
    ├── 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-app2 ericholland$

- I've looked at /node_modules/ajv/package.json and it looks like 5.2.2 is installed as part of create-react-app:
{
"_from": "ajv@^5.2.0",
"_id": "ajv@5.5.2",
"_inBundle": false,
"_integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=",
"_location": "/ajv",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "ajv@^5.2.0",
"name": "ajv",
"escapedName": "ajv",
"rawSpec": "^5.2.0",
"saveSpec": null,
"fetchSpec": "^5.2.0"
},
"_requiredBy": [
"/eslint",
"/har-validator",
"/schema-utils",
"/webpack"
],
"_resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz",
"_shasum": "73b5eeca3fab653e3d3f9422b341ad42205dc965",
"_spec": "ajv@^5.2.0",
"_where": "/Users/ericholland/Documents/work/development/react/prototype/my-app3/node_modules/eslint",
"author": {
"name": "Evgeny Poberezkin"
},
"bugs": {
"url": "https://github.com/epoberezkin/ajv/issues"
},
"bundleDependencies": false,
"dependencies": {
"co": "^4.6.0",
"fast-deep-equal": "^1.0.0",
"fast-json-stable-stringify": "^2.0.0",
"json-schema-traverse": "^0.3.0"
},
"deprecated": false,
"description": "Another JSON Schema Validator",
"devDependencies": {
"ajv-async": "^0.1.0",
"bluebird": "^3.1.5",
"brfs": "^1.4.3",
"browserify": "^14.1.0",
"chai": "^4.0.1",
"coveralls": "^3.0.0",
"del-cli": "^1.1.0",
"dot": "^1.0.3",
"eslint": "^4.1.0",
"gh-pages-generator": "^0.2.0",
"glob": "^7.0.0",
"if-node-version": "^1.0.0",
"js-beautify": "^1.7.3",
"jshint": "^2.9.4",
"json-schema-test": "^2.0.0",
"karma": "^1.0.0",
"karma-chrome-launcher": "^2.0.0",
"karma-mocha": "^1.1.1",
"karma-phantomjs-launcher": "^1.0.0",
"karma-sauce-launcher": "^1.1.0",
"mocha": "^4.0.0",
"nodent": "^3.0.17",
"nyc": "^11.0.2",
"phantomjs-prebuilt": "^2.1.4",
"pre-commit": "^1.1.1",
"regenerator": "^0.12.2",
"require-globify": "^1.3.0",
"typescript": "^2.6.2",
"uglify-js": "^3.1.5",
"watch": "^1.0.0"
},
"files": [
"lib/",
"dist/",
"scripts/",
"LICENSE",
".tonic_example.js"
],
"homepage": "https://github.com/epoberezkin/ajv",
"keywords": [
"JSON",
"schema",
"validator",
"validation",
"jsonschema",
"json-schema",
"json-schema-validator",
"json-schema-validation"
],
"license": "MIT",
"main": "lib/ajv.js",
"name": "ajv",
"nyc": {
"exclude": [
"/spec/",
"node_modules"
],
"reporter": [
"lcov",
"text-summary"
]
},
"repository": {
"type": "git",
"url": "git+https://github.com/epoberezkin/ajv.git"
},
"scripts": {
"build": "del-cli lib/dotjs/.js && node scripts/compile-dots.js",
"bundle": "node ./scripts/bundle.js . Ajv pure_getters",
"bundle-all": "del-cli dist && npm run bundle && npm run bundle-regenerator && npm run bundle-nodent",
"bundle-beautify": "node ./scripts/bundle.js js-beautify",
"bundle-nodent": "node ./scripts/bundle.js nodent",
"bundle-regenerator": "node ./scripts/bundle.js regenerator",
"eslint": "if-node-version ">=4" eslint lib/
.js lib/compile/.js spec/.js scripts",
"jshint": "jshint lib/.js lib/**/.js --exclude lib/dotjs/**/",
"prepublish": "npm run build && npm run bundle-all",
"test": "npm run jshint && npm run eslint && npm run test-ts && npm run build && npm run test-cov && if-node-version 4 npm run test-browser",
"test-browser": "del-cli .browser && npm run bundle-all && scripts/prepare-tests && npm run test-karma",
"test-cov": "nyc npm run test-spec",
"test-debug": "mocha spec/
.spec.js --debug-brk -R spec",
"test-fast": "AJV_FAST_TEST=true npm run test-spec",
"test-karma": "karma start --single-run --browsers PhantomJS",
"test-spec": "mocha spec/*.spec.js -R spec $(if-node-version 7 echo --harmony-async-await)",
"test-ts": "tsc --target ES5 --noImplicitAny lib/ajv.d.ts",
"watch": "watch 'npm run build' ./lib/dot"
},
"tonicExampleFilename": ".tonic_example.js",
"typings": "lib/ajv.d.ts",
"version": "5.5.2"
}

- I've looked at /node_modules/ajv/package.json and it does require ajv 6.0.0 as dep:
"_from": "ajv-keywords@^3.0.0",
"_id": "ajv-keywords@3.1.0",
"_inBundle": false,
"_integrity": "sha1-rCsnk5xUPpXSwG5/f1wnvkqlQ74=",
"_location": "/ajv-keywords",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "ajv-keywords@^3.0.0",
"name": "ajv-keywords",
"escapedName": "ajv-keywords",
"rawSpec": "^3.0.0",
"saveSpec": null,
"fetchSpec": "^3.0.0"
},
"_requiredBy": [
"/table"
],
"_resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.1.0.tgz",
"_shasum": "ac2b27939c543e95d2c06e7f7f5c27be4aa543be",
"_spec": "ajv-keywords@^3.0.0",
"_where": "/Users/ericholland/Documents/work/development/react/prototype/my-app3/node_modules/table",
"author": {
"name": "Evgeny Poberezkin"
},
"bugs": {
"url": "https://github.com/epoberezkin/ajv-keywords/issues"
},
"bundleDependencies": false,
"deprecated": false,
"description": "Custom JSON-Schema keywords for Ajv validator",
"devDependencies": {
"ajv": "^6.0.0",
"ajv-pack": "^0.3.0",
"chai": "^4.0.2",
"coveralls": "^3.0.0",
"dot": "^1.1.1",
"eslint": "^4.9.0",
"glob": "^7.1.1",
"istanbul": "^0.4.3",
"js-beautify": "^1.7.4",
"json-schema-test": "^2.0.0",
"mocha": "^4.0.0",
"pre-commit": "^1.1.3",
"uuid": "^3.0.1"
},
"files": [
"index.js",
"keywords"
],
"homepage": "https://github.com/epoberezkin/ajv-keywords#readme",
"keywords": [
"JSON-Schema",
"ajv",
"keywords"
],
"license": "MIT",
"main": "index.js",
"name": "ajv-keywords",
"peerDependencies": {
"ajv": "^6.0.0"
},
"repository": {
"type": "git",
"url": "git+https://github.com/epoberezkin/ajv-keywords.git"
},
"scripts": {
"build": "node node_modules/ajv/scripts/compile-dots.js node_modules/ajv/lib keywords",
"eslint": "eslint index.js keywords/.js",
"prepublish": "npm run build",
"test": "npm run build && npm run eslint && npm run test-cov",
"test-cov": "istanbul cover -x 'spec/**' node_modules/mocha/bin/_mocha -- spec/
.spec.js -R spec",
"test-spec": "mocha spec/*.spec.js -R spec"
},
"version": "3.1.0"
}

I know by running npm install ajv it installs 6.4.0 and the warning / error goes away, but that doesn't feel like the best way. What is the best way to resolve this?

thanks
Eric

@Fasani
Copy link

Fasani commented Apr 3, 2018

I have the same issue. Wondering the same:

I know by running npm install ajv it installs 6.4.0 and the warning / error goes away, but that doesn't feel like the best way. What is the best way to resolve this?

@gaearon
Copy link
Contributor

gaearon commented Apr 3, 2018

What does npm ls ajv-keywords output?

@gaearon
Copy link
Contributor

gaearon commented Apr 3, 2018

This looks like an npm bug. npm/npm#19877

I suggest to use Yarn if this is annoying. Seems like Yarn doesn't have this bug.

@gaearon gaearon closed this as completed Apr 3, 2018
@eholland7080
Copy link
Author

@gaearon good suggestion. I did switch to yarn and did not experience the issue. thank you
Eric

@dojchek
Copy link

dojchek commented May 26, 2018

The error is not visible with yarn, only in 'install' output. If you run yarn check, these errors are still there.

karine-larouche pushed a commit to karine-larouche/challenge-tracker that referenced this issue Jul 10, 2018
karine-larouche added a commit to karine-larouche/challenge-tracker that referenced this issue Dec 10, 2018
@lock lock bot locked and limited conversation to collaborators Jan 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants