Module not found: Can't resolve '@emotion/react' in node_modules\@emotion\styled\base\dist'

8.6k views Asked by At

I tried the npm install @emotion/react and npm install @emotion/styled solutions and the error is not cleared.

Kindly help

 "dependencies": {
    "@emotion/styled": "^11.3.0",
    "@material-ui/core": "^4.12.3",
    "@mui/material": "^5.1.0",
    "@testing-library/jest-dom": "^5.15.0",
    "@testing-library/react": "^11.2.7",
    "@testing-library/user-event": "^12.8.3",
    "axios": "^0.24.0",
    "chart.js": "^3.6.0",
    "react": "^17.0.2",
    "react-dom": "^17.0.2",
    "react-scripts": "4.0.3",
    "web-vitals": "^1.1.2"
  },
2

There are 2 answers

5
Ashish Kamble On

you have not installed npm packages correctly, so, try to install them again using this command, those are missing from package.json, not installed properly

npm install @emotion/styled 
npm install @emotion/core
npm install @emotion/styled

or try installing them with --save flag

this is also worked for my friend,

yarn add @emotion/react @emotion/styled styled-components @emotion/core
0
Farish.py.js On

After installing npm install @emotion/styled @emotion/core @emotion/react --save. Then Terminate the running Server and restart npm start.It worked for me.... this may work for you too.