Skip to content
This repository has been archived by the owner on Sep 3, 2021. It is now read-only.

peer dependency issue when installing #585

Open
YizYah opened this issue Feb 3, 2021 · 4 comments
Open

peer dependency issue when installing #585

YizYah opened this issue Feb 3, 2021 · 4 comments

Comments

@YizYah
Copy link

YizYah commented Feb 3, 2021

When installing the latest version of the package I'm getting a peer dependency issue among other warnings:

$ npm install --save neo4j-graphql-js
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! Found: graphql@15.5.0
npm ERR! node_modules/graphql
npm ERR!   peer graphql@"^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0" from apollo-cache-control@0.11.6
npm ERR!   node_modules/apollo-cache-control
npm ERR!     apollo-cache-control@"^0.11.6" from apollo-server-core@2.19.2
npm ERR!     node_modules/apollo-server-core
npm ERR!       apollo-server-core@"^2.19.2" from apollo-server@2.19.2
npm ERR!       node_modules/apollo-server
npm ERR!       1 more (apollo-server-express)
npm ERR!   peer graphql@"^14.2.1 || ^15.0.0" from apollo-graphql@0.6.0
npm ERR!   node_modules/apollo-graphql
npm ERR!     apollo-graphql@"^0.6.0" from apollo-server-core@2.19.2
npm ERR!     node_modules/apollo-server-core
npm ERR!       apollo-server-core@"^2.19.2" from apollo-server@2.19.2
npm ERR!       node_modules/apollo-server
npm ERR!       1 more (apollo-server-express)
npm ERR!   46 more (apollo-link, apollo-server, apollo-server-core, ...)
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer graphql@"~14.x" from graphql-auth-directives@2.2.1
npm ERR! node_modules/graphql-auth-directives
npm ERR!   graphql-auth-directives@"^2.2.1" from neo4j-graphql-js@2.19.1
npm ERR!   node_modules/neo4j-graphql-js
npm ERR!     neo4j-graphql-js@"*" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR! 
npm ERR! See /home/yisroel/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/yisroel/.npm/_logs/2021-02-03T15_06_14_128Z-debug.log

eresolve-report.txt

Creating a new project and starting with neo4j-graphql-js I get this:

$ npm install --save neo4j-graphql-js
npm WARN ERESOLVE overriding peer dependency
npm WARN Found: graphql@15.5.0
npm WARN node_modules/graphql
npm WARN   graphql@"^15.4.0" from neo4j-graphql-js@2.19.1
npm WARN   node_modules/neo4j-graphql-js
npm WARN     neo4j-graphql-js@"*" from the root project
npm WARN   1 more (apollo-server-errors)
npm WARN 
npm WARN Could not resolve dependency:
npm WARN peer graphql@"~14.x" from graphql-auth-directives@2.2.1
npm WARN node_modules/graphql-auth-directives
npm WARN   graphql-auth-directives@"^2.2.1" from neo4j-graphql-js@2.19.1
npm WARN   node_modules/neo4j-graphql-js
npm WARN deprecated core-js@2.6.12: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.

added 319 packages, and audited 320 packages in 21s

20 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

I've attached the report.

@johnymontana
Copy link
Member

Looks like the issue here is graphql-auth-directives requires a peer dependency of graphql v14, however neo4j-graphql-js currently uses graphql v15. I've updated that peer dependency in graphql-auth-directives to include graphql v15 which I believe should resolve this error and should be reflected in the latest release of neo4j-graphql-js v2.19.2

@YizYah
Copy link
Author

YizYah commented Feb 7, 2021

I am able to run create-grandstack-app, but when I try installing to a current server app once again npm cannot resolve the dependency tree. [Note: a colleague cannot reproduce this. I'm not sure why it's happening to me.]

Here are my dependencies:

 "dependencies": {
    "apollo-server": "^2.19.2",
    "aws-sdk": "^2.838.0",
    "dotenv": "^8.2.0",
    "graphql": "^14.7.0",
    "graphql-middleware": "^6.0.3",
    "graphql-shield": "^7.5.0",
    "graphql-tools": "^4.0.8",
    "neo4j-driver": "^4.2.2"
  },

Here's what happens when I try to install the package:

$ npm i neo4j-graphql-js
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! Found: graphql@14.7.0
npm ERR! node_modules/graphql
npm ERR!   graphql@"^14.7.0" from the root project
npm ERR!   peer graphql@"~14.x || ~15.x" from graphql-auth-directives@2.2.2
npm ERR!   node_modules/graphql-auth-directives
npm ERR!     graphql-auth-directives@"^2.2.2" from neo4j-graphql-js@2.19.2
npm ERR!     node_modules/neo4j-graphql-js
npm ERR!       neo4j-graphql-js@"*" from the root project
npm ERR!   23 more (@graphql-tools/batch-delegate, ...)
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer graphql@"^15.0.0" from relay-compiler@10.1.0
npm ERR! node_modules/@graphql-tools/relay-operation-optimizer/node_modules/relay-compiler
npm ERR!   relay-compiler@"10.1.0" from @graphql-tools/relay-operation-optimizer@6.3.0
npm ERR!   node_modules/@graphql-tools/relay-operation-optimizer
npm ERR!     @graphql-tools/relay-operation-optimizer@"^6.2.5" from graphql-tools@7.0.2
npm ERR!     node_modules/neo4j-graphql-js/node_modules/graphql-tools
npm ERR!       graphql-tools@"^7.0.2" from neo4j-graphql-js@2.19.2
npm ERR!       node_modules/neo4j-graphql-js
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR! 
npm ERR! See /home/yisroel/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/yisroel/.npm/_logs/2021-02-07T13_59_25_929Z-debug.log

If I use --legacy-peer-deps I get:

$ npm i neo4j-graphql-js --legacy-peer-deps
npm WARN deprecated core-js@2.6.12: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.

added 236 packages, removed 6 packages, changed 6 packages, and audited 611 packages in 16s

10 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
$ npm list core-js
simplejs@1.0.0 /home/yisroel/temp/sample/simplejs
+-- apollo-server@2.19.2
| `-- apollo-server-core@2.19.2
|   `-- @apollographql/apollo-tools@0.4.8
|     `-- apollo-env@0.6.5
|       `-- core-js@3.8.3
`-- neo4j-graphql-js@2.19.2
  `-- @babel/runtime-corejs2@7.12.13
    `-- core-js@2.6.12

I'm running node 15.8.

@YizYah
Copy link
Author

YizYah commented Feb 15, 2021

I have an update:
It does work with the following dependencies:

    "apollo-server": "^2.21.0",
    "graphql": "^15.5.0",
    "graphql-tools": "^7.0.3",
    "neo4j-driver": "^4.2.2",
    "neo4j-graphql-js": "^2.19.2"

I don't know why I had the older versions of apollo-server and graphql. I imagine that I got them from the last grandstack. I suppose this isn't a problem unless the grandstack is still using the older graphql.

@michaeldgraham
Copy link
Collaborator

#608

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

3 participants