首页 > 解决方案 > 我正在尝试安装 Material-UI,但我不断收到一长串错误:

问题描述

我已经使用 npx install 安装了 react 没有问题,但是当我尝试安装 material-UI 时,它没有正确安装。请看下面的代码

npm install @material-ui/core 
npm WARN saveError ENOENT: no such file or directory, open '/Users/alirahman/package.json'
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN enoent ENOENT: no such file or directory, open '/Users/alirahman/package.json'
npm WARN @material-ui/core@4.5.0 requires a peer of react@^16.8.0 but none is installed. You must install peer dependencies yourself.
npm WARN @material-ui/core@4.5.0 requires a peer of react-dom@^16.8.0 but none is installed. You must install peer dependencies yourself.
npm WARN react-transition-group@4.3.0 requires a peer of react@>=16.6.0 but none is installed. You must install peer dependencies yourself.
npm WARN react-transition-group@4.3.0 requires a peer of react-dom@>=16.6.0 but none is installed. You must install peer dependencies yourself.
npm WARN @material-ui/styles@4.5.0 requires a peer of react@^16.8.0 but none is installed. You must install peer dependencies yourself.
npm WARN @material-ui/styles@4.5.0 requires a peer of react-dom@^16.8.0 but none is installed. You must install peer dependencies yourself.
npm WARN @material-ui/utils@4.4.0 requires a peer of react@^16.8.0 but none is installed. You must install peer dependencies yourself.
npm WARN @material-ui/utils@4.4.0 requires a peer of react-dom@^16.8.0 but none is installed. You must install peer dependencies yourself.
npm WARN @material-ui/system@4.5.0 requires a peer of react@^16.8.0 but none is installed. You must install peer dependencies yourself.
npm WARN @material-ui/system@4.5.0 requires a peer of react-dom@^16.8.0 but none is installed. You must install peer dependencies yourself.
npm WARN alirahman No description
npm WARN alirahman No repository field.
npm WARN alirahman No README data
npm WARN alirahman No license field.

标签: reactjs

解决方案


我遇到的问题是我不小心在我的服务器端 NPM 文件夹以及客户端文件夹中安装了材料 ui 核心,因此服务器端 npm 模块正在寻找一个不存在的 react 版本。就这么简单吗?


推荐阅读