gatsby-plugin-dark-mode icon indicating copy to clipboard operation
gatsby-plugin-dark-mode copied to clipboard

React 17

Open axelra82 opened this issue 3 years ago • 5 comments

Installing on latest react (17.x)

Could not resolve dependency:
npm ERR! peer react@"16.x" from [email protected]

axelra82 avatar May 20 '21 14:05 axelra82

Looks like alvinometric made a fix, just needs merging in: https://github.com/insin/gatsby-plugin-dark-mode/pull/15

sebrave avatar Jun 04 '21 04:06 sebrave

Yep, still waiting 😄 As a temporary fix, you can downgrade your NPM to a version less than 7

ghost avatar Jun 28 '21 21:06 ghost

I'm using NPM 7 and have successfully installed using the --legacy-peer-deps flag

npm i gatsby-plugin-dark-mode --legacy-peer-deps

mrocha98 avatar Jul 11 '21 01:07 mrocha98

I'm using NPM 7 and have successfully installed using the --legacy-peer-deps flag

npm i gatsby-plugin-dark-mode --legacy-peer-deps

It works for me, thanks!

dinhanhthi avatar Feb 22 '22 14:02 dinhanhthi

I could use the --legacy-peer-deps workaround locally with npm@7, but for remote CI/CD builds using Gatsby Cloud it's necessary to instruct the build process to use npm@6 instead (the downgrade mentioned above), using the engines property in package.json:

  "engines": {
    "node": "^16",
    "npm": "^6"
  },

This worked for me. I know Heroku's node buildpacks also respect npm engine versions, Vercel and others probably do too.

th0rgall avatar Sep 22 '22 16:09 th0rgall