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:
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