Using material UI you are relaying on the backbone of npm packages like “@emotion/styled” and “@emotion/react”, this open more opportunity for material UI by google but also can be frustrating to see error of module not found.
Reading into material ui docs it will be easy to see that material ui relay on 2 dependencies however, material ui dose not brings them as peer-dependencies, this is why module not found can be evoke when trying to install material ui directly. and modules like emotion/react can’t resolve. this is why the first thing i tend to do is to read up the docs. reading the docs also makes it easier to decided whether if you want or not to use a specific technology for your work and project. so don’t get stuck with module not found! read the docs first!
Solution
install both packages:
npm install @emotion/react @emotion/styled
This will provide all the dependencies you’ll need for your material UI project.
Lior Amsalem embarked on his software engineering journey in the early 2000s, Diving into Pascal with a keen interest in creating, developing, and working on new technologies. Transitioning from his early teenage years as a freelancer, Lior dedicated countless hours to expanding his knowledge within the software engineering domain. He immersed himself in learning new development languages and technologies such as JavaScript, React, backend, frontend, devops, nextjs, nodejs, mongodb, mysql and all together end to end development, while also gaining insights into business development and idea implementation.
Through his blog, Lior aims to share his interests and entrepreneurial journey, driven by a desire for independence and freedom from traditional 9-5 work constraints.
Leave a Reply