question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot install material ui core

See original GitHub issue

Preliminary Checks

Description

When trying to install @material-ui/core, I’m getting this error:

npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: gatsby-starter-default@0.1.0
npm ERR! Found: react@18.2.0
npm ERR! node_modules/react
npm ERR!   react@"^18.2.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.8.0 || ^17.0.0" from @material-ui/core@4.12.4
npm ERR! node_modules/@material-ui/core
npm ERR!   @material-ui/core@"*" 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 C:\Users\omerf\AppData\Local\npm-cache\eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\omerf\AppData\Local\npm-cache\_logs\2022-06-18T23_03_12_616Z-debug-0.log

Installing with the flag “–legacy-peer-deps” works, but then the app breaks completely when running “npm run develop”:

PS E:\DEV\Projects\strapi\frontend> npm run develop

npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.

> gatsby-starter-default@0.1.0 develop
> gatsby develop


 ERROR #11901  COMPILATION

Failed to compile Gatsby files (Error):

Could not resolve module "@parcel/namer-default" from "E:\\DEV\\Projects\\strapi\\frontend\\node\_modules\\@gatsbyjs\\parcel-namer-relative-to-cwd\\lib\\index.js".

not finished compile gatsby files - 1.567s

Thanks in advance

Reproduction Link

none

Steps to Reproduce

  1. Create a new gatsby project
  2. run npm i @material-ui/core

Expected Result

installing material ui core won’t throw an error

Actual Result

Throws an error

Environment

System:
    OS: Windows 10 10.0.19044
    CPU: (16) x64 AMD Ryzen 9 4900H with Radeon Graphics
  Binaries:
    Node: 16.15.1 - C:\Program Files\nodejs\node.EXE
    npm: 8.11.0 - C:\Program Files\nodejs\npm.CMD
  Browsers: {}
  npmPackages:
    gatsby: ^4.16.0 => 4.16.0
    gatsby-plugin-gatsby-cloud: ^4.16.0 => 4.16.0
    gatsby-plugin-image: ^2.16.1 => 2.16.1
    gatsby-plugin-manifest: ^4.16.0 => 4.16.0
    gatsby-plugin-material-ui: ^4.1.0 => 4.1.0
    gatsby-plugin-offline: ^5.16.0 => 5.16.0
    gatsby-plugin-react-helmet: ^5.16.0 => 5.16.0
    gatsby-plugin-sharp: ^4.16.1 => 4.16.1
    gatsby-source-filesystem: ^4.16.0 => 4.16.0
    gatsby-source-strapi: ^2.0.0 => 2.0.0
    gatsby-transformer-remark: ^5.16.0 => 5.16.0
    gatsby-transformer-sharp: ^4.16.0 => 4.16.0
  npmGlobalPackages:
    gatsby-cli: 4.16.0

Config Flags

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:2
  • Comments:14 (2 by maintainers)

github_iconTop GitHub Comments

9reactions
patotomacommented, Jun 20, 2022

getting the same error after updating to gatsby 4.16.0

installing @parcel/namer-default locally using npm i -D @parcel/namer-default fixes this

2reactions
patotomacommented, Jul 14, 2022

Thanks for the fix @LekoArts .

Since gatsby version 4.18.2 there is no need to manually install @parcel/namer-default and can be removed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

cannot install @material-ui/core using npm - Stack Overflow
json. Search for the react and react-dom packages under dependencies (or devDependencies) and replace their versions with 16.13.0. Then run npm ...
Read more >
Cannot install @material-ui/core with npm 7 and React 17
On the base template of create-react-app v4 with typescript material-ui/core complains about the version of react.
Read more >
@material-ui/core - npm
Author message: Material UI v4 doesn't receive active development since September 2021. See the guide https://mui.com/material-ui/migration/ ...
Read more >
Installation - Material UI - MUI
Install Material UI, the world's most popular React UI framework.
Read more >
Installation - material-table/core
Already using material-table ? After installing @material-table/core , simply update your imports and you're good to go! ... npm install @material-ui/core.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found