Error installing gatsby-source-prismic with the latest Gatsby (4.0.2)

sudo npm install -g gatsby-cli

gatsby new demosite

cd demosite

npm install gatsby-source-prismic

BOOM ERROR!

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! Found: gatsby@4.0.2
npm ERR! node_modules/gatsby
npm ERR!   gatsby@"^4.0.2" from the root project
npm ERR!   peer gatsby@"^3.0.0-next.0 || ^4.0.0-next.0" from gatsby-source-prismic@5.0.2
npm ERR!   node_modules/gatsby-source-prismic
npm ERR!     gatsby-source-prismic@"*" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer gatsby@"^2 || ^3" from @imgix/gatsby@1.6.13
npm ERR! node_modules/gatsby-source-prismic/node_modules/@imgix/gatsby
npm ERR!   @imgix/gatsby@"^1.6.13" from gatsby-source-prismic@5.0.2
npm ERR!   node_modules/gatsby-source-prismic
npm ERR!     gatsby-source-prismic@"*" 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 /Users/adrianparr/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/adrianparr/.npm/_logs/2021-11-01T21_49_49_073Z-debug.log

Hi @adrianparr,

Thanks for the report. This is a common issue with NPM 7/8 due to its change in peer dependency management.

While the error is technically correct since @imgix/gatsby does not explicitly state that it is compatible with Gatsby 4, you should be able to safely ignore it and continue with installation.

You can use npm install gatsby-source-prismic --legacy-peer-deps until @imgix/gatsby updates its package.

You can find more detailed installation instructions, including gatsby-source-prismic's own peer dependencies, on this page: Install the Gatsby Source Plugin - Prismic

Hi angeloashmore,

Thank you for your speedy reply. I'll give it a try. Cheers.

Adrian

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.