Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to add the Material UI package to React app

I want to add material-ui/icon package to my react app. If I run npm install @mui/material @emotion/react @emotion/styled in my root folder I get the following error:

Invalid package name "material-ui/icons" of package "material-ui/icons@": name can only contain URL-friendly characters.

I also tried to install the package with the following commands:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

yarn add @material-ui/icons

npm install @material-ui/core

npm install @emotion/react

yarn add @mui/material @emotion/react @emotion/styled

npm install --save material-ui/icon

Nothing of it worked. In the case of yarn I got the following error zsh: command not found: yarn because I don’t have yarn installed. How can I install the package?

>Solution :

Try this npm install @emotion/react @emotion/styled @mui/icons-material @mui/material

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading