Home > Blockchain >  Does new version of Gatsby not work with Material UI?
Does new version of Gatsby not work with Material UI?

Time:01-07

I am running into this error

portfolio % npm install gatsby-theme-material-ui
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/gatsby
npm ERR!   gatsby@"^5.3.3" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer gatsby@"^3.0.0 || ^4.0.0" from [email protected]
npm ERR! node_modules/gatsby-theme-material-ui
npm ERR!   gatsby-theme-material-ui@"*" from the root project
npm ERR! 

Within my gatsby config I have the plugin but am noticing some weird styling for production. I assumed it was because it is missing something like gatsby-theme-material-ui for it to work.

Any ideas?

CodePudding user response:

gatsby-theme-material-ui is not an official plugin so it's only maintained and supported by his author and contributors. This means that you are relying on Gatsby's package version which is expecting a version 3 or 4 (gatsby@"^3.0.0 || ^4.0.0") while you have the 5.3.3.

If looking for other alternative plugins is not an option, you can bypass the dependency tree issue by running:

npm install gatsby-theme-material-ui --legacy-peer-deps

The --legacy-peer-deps will resolve the (old) legacy dependencies for the package.

https://github.com/hupe1980/gatsby-theme-material-ui/issues/84

CodePudding user response:

npm install gatsby-theme-material-ui --force I am not responsible if there is a problem because it makes it mandatory.

  • Related