[gatsby-theme-minimal-blog]: Failing to install the theme
See original GitHub issueDescription
I’m getting an error when running:
npm install @lekoarts/gatsby-theme-minimal-blog
It seems it could be related to needing to update a few dependencies (react):
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: undefined@undefined
npm ERR! Found: react@17.0.2
npm ERR! node_modules/react
npm ERR! react@"^17.0.2" from the root project
npm ERR! peer react@"^16.4.2 || ^17.0.0" from gatsby@2.32.13
npm ERR! node_modules/gatsby
npm ERR! peer gatsby@"^2.13.3" from @lekoarts/gatsby-theme-minimal-blog@2.7.6
npm ERR! node_modules/@lekoarts/gatsby-theme-minimal-blog
npm ERR! @lekoarts/gatsby-theme-minimal-blog@"*" from the root project
npm ERR! 1 more (react-dom)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.9.0" from @lekoarts/gatsby-theme-minimal-blog@2.7.6
npm ERR! node_modules/@lekoarts/gatsby-theme-minimal-blog
npm ERR! @lekoarts/gatsby-theme-minimal-blog@"*" 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 ~/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! ~/.npm/_logs/2021-05-31T21_46_46_081Z-debug.log
Steps to reproduce
Start a fresh theme install.
Expected result
NPM should install all the dependencies from the theme.
Actual result
It fails.
Environment
Run gatsby info --clipboard
in your project directory and paste the output here:
System:
OS: macOS 11.3
CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
Shell: 3.2.2 - /usr/local/bin/fish
Binaries:
Node: 16.2.0 - /usr/local/bin/node
npm: 7.13.0 - /usr/local/bin/npm
Languages:
Python: 2.7.16 - /usr/bin/python
Browsers:
Chrome: 90.0.4430.212
Firefox: 85.0.1
Safari: 14.1
npmGlobalPackages:
gatsby-cli: 3.6.0
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Minimal-blog: Mdx error on build on fresh project #391
I have installed fresh new project using gatsby new minimal-blog ... I have also updated package @lekoarts/gatsby-theme-minimal-blog to 2.3.
Read more >lekoarts/gatsby-theme-minimal-blog
Typography driven, feature-rich blogging theme with minimal aesthetics. Includes tags/categories support and extensive features for code ...
Read more >Can't install Gatsby starter theme because of Sharp module ...
To me, it's failing due to some Visual Studio issue, not a sharp, because of the following command: gyp ERR! stack Error: spawn...
Read more >Using and customizing official Gatsby themes from scratch ...
I do this by manually creating a minimal package.json file in my root ... We are installing two official themes, gatsby-theme-blog and ...
Read more >gatsby-theme-blog-material-clarisse - npm package
Alternatively, you can add Clarisse theme to an existing Gatsby project. # Install the theme yarn add @tacogator/gatsby-theme-blog-material-clarisse. Add theme ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi!
TL;DR see this SO for a longer explanation: https://stackoverflow.com/a/66620869/10164092
The theme is on the latest Gatsby v2 version (and the v3 release is under its way: https://github.com/LekoArts/gatsby-themes/issues/570) and thus has some older dependencies in them that declared React 16 as a peerDependency. npm 7 by default will try to be “clever” and install those. You’ll want to keep the old behavior and use the
--legacy-peer-deps
flag. Unfortunately we also saw this in the v2 => v3 migration (https://www.gatsbyjs.com/docs/reference/release-notes/migrating-from-v2-to-v3/#update-gatsby-version) so maybe going forward I’ll change up the install instructions and add the flag by default.The deprecated packages you mentioned are out of my control, those are all Gatsby dependencies. Updating to v3 should help there, too.
I had this problem too, the v3 update to gatsby didn’t fixed it. Since I wanted to use the starter by using
gatsby new
then the npm--legacy-peer-deps
flag didn’t help. For reference to anyone else, what did help was install globally gatsby using yarn, and setting it as its default package manager, see https://www.gatsbyjs.com/docs/glossary/yarn/ .If you want I can do a commit to the minimal-blog theme detailing this @LekoArts , also since I am already here, thanks for the great themes!