gatsby-plugin-dark-mode
gatsby-plugin-dark-mode copied to clipboard
React 17
Installing on latest react (17.x)
Could not resolve dependency:
npm ERR! peer react@"16.x" from [email protected]
Looks like alvinometric made a fix, just needs merging in: https://github.com/insin/gatsby-plugin-dark-mode/pull/15
Yep, still waiting 😄 As a temporary fix, you can downgrade your NPM to a version less than 7
I'm using NPM 7 and have successfully installed using the --legacy-peer-deps
flag
npm i gatsby-plugin-dark-mode --legacy-peer-deps
I'm using NPM 7 and have successfully installed using the
--legacy-peer-deps
flagnpm i gatsby-plugin-dark-mode --legacy-peer-deps
It works for me, thanks!
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.