Gouri krishna s
Gouri krishna s

Reputation: 1

Module not found error for '@material-ui/core' in React project

I'm encountering a "Module not found" error in my React project when trying to import '@material-ui/core' in one of my components. The error specifically points to the file located in 'C:\Main Project\resumebuilder\src\components'. I have already installed the '@material-ui/core' package using npm, and it appears in my 'node_modules' directory.

Here's the relevant import statement in my component:

import {Button,TextField} from '@material-ui/core'

And here's the error message:
Module not found: Error: Can't resolve '@material-ui/core' in 'C:\Main Project\resumebuilder\src\components'

I've tried the following troubleshooting steps:

  1. Ensured that '@material-ui/core' is listed as a dependency in my 'package.json'.

  2. Deleted 'node_modules' and 'package-lock.json', then ran 'npm install' again.

  3. Checked for typos in the import statement and the package name.

Despite these efforts, the error persists. Any guidance on how to resolve this issue would be greatly appreciated!

Upvotes: 0

Views: 80

Answers (1)

Mohamed Zouine
Mohamed Zouine

Reputation: 86

Ensure that you are using a recent version of Node.js and npm. You can update them by running: npm install -g npm

Upvotes: 1

Related Questions