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

Incorrect warnings reported by npm on fresh installation of Gatsby #13243

Closed
theNaut1lus opened this issue Apr 9, 2019 · 8 comments
Closed
Labels
good first issue Issue that doesn't require previous experience with Gatsby type: maintenance An issue or pull request describing a change that isn't a bug, feature or documentation change

Comments

@theNaut1lus
Copy link

Description

On following along with the tutorial and installing Gatsby globally on my machine I encountered this error from npm regarding wrong dependencies listed in some modules pf Gatsby.

Screenshot 2019-04-09 at 11 28 16 AM

Steps to reproduce

I encountered this issue when I was installing Gatsby for the very first time, I feel that this warning will occur every time npm encounters with Gatsby (or these resources of Gatsby.)
For some reason npm thinks that these modules don't need Gatsby as a peer dependency which seems like a fault because these modules are a core part of the framework.

Expected result

On installation of Gatsby, there shouldn't be any incorrect dependency faults like the one that occurred in the screenshot.

Actual result

Aforementioned warnings reported by npm in the console.

Environment

System:
OS: macOS 10.14.4
CPU: (4) x64 Intel(R) Core(TM) i5-4278U CPU @ 2.60GHz
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 10.15.1 - /usr/local/bin/node
Yarn: 1.13.0 - /usr/local/bin/yarn
npm: 6.9.0 - /usr/local/bin/npm
Languages:
Python: 2.7.10 - /usr/bin/python
Browsers:
Chrome: 71.0.3578.98
Firefox: 64.0.2
Safari: 12.1
npmPackages:
gatsby: ^2.3.15 => 2.3.15
npmGlobalPackages:
gatsby-cli: 2.5.5

@sidharthachatterjee
Copy link
Contributor

Thank you for opening this @co16353sidak

So we updated graphql to ^14.1.1 but

  • express-graphql is at 0.6.12
  • eslint-plugin-graphql is at 2.0.0
  • graphql-tools is at 3.0.4

To get rid of the peer dependency warnings, we need to update these dependencies to

  • express-graphql to 0.7.1 (should be fine since it's a minor bump)
  • graphql-tools to 4.0.0 (should be fine according to CHANGELOG since the breaking changes are mostly to accommodate graphql 14.1.1 which we use)
  • eslint-plugin-graphql to v3.0.3 (on first glance of CHANGELOG, seems to be fine)

BREAKING: The required-fields rule has been significantly changed to make it a completely reliable method of ensuring an id field (or any other field name) is always requested when available.

This is the only thing I'm not sure of but since it's a eslint plugin, it shouldn't affect core code but in a worse case scenario, should a couple of lint errors.

Would you like to go ahead and open a PR updating these?

@sidharthachatterjee sidharthachatterjee added good first issue Issue that doesn't require previous experience with Gatsby type: maintenance An issue or pull request describing a change that isn't a bug, feature or documentation change labels Apr 10, 2019
@theNaut1lus
Copy link
Author

@sidharthachatterjee would love to work on this 👍

@theNaut1lus
Copy link
Author

@sidharthachatterjee not able to find a way to start working on this, how should I go about updating the dependencies mentioned above ?
This is my first time tackling this sort of an issue.

@eclectic-coding
Copy link
Contributor

@co16353sidak Looks like the package.json is in the packages directory

@stefanprobst
Copy link
Contributor

stefanprobst commented Apr 11, 2019

We have updated those dependencies before and ran into an issue with the graphql-tools update (which is used by gatsby-source-graphql). This should (hopefully) be fixed by ardatan/graphql-tools#1075 which unfortunately has not been reviewed yet. See #11512

@pieh
Copy link
Contributor

pieh commented Apr 11, 2019

We have updated those dependencies before and ran into an issue with the graphql-tools update (which is used by gatsby-source-graphql).

Ah, right. But we don't use graphql-tools anymore in gatsby itself (it's still dependency there), so we should be able to remove it. It seems like it's only used in gatsby-source-graphql at this point

@stefanprobst
Copy link
Contributor

Yes, gatsby-source-graphql is the only one still using graphql-tools.

DSchau pushed a commit that referenced this issue Apr 12, 2019
## Incorrect warnings reported by npm on fresh installation of Gatsby #13243

Basic maintenance, updating:

- express-graphql to 0.7.1 
- graphql-tools to 4.0.0
- eslint-plugin-graphql to v3.0.3
@stefanprobst
Copy link
Contributor

Fixed by #13296

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Issue that doesn't require previous experience with Gatsby type: maintenance An issue or pull request describing a change that isn't a bug, feature or documentation change
Projects
None yet
Development

No branches or pull requests

5 participants