reactjs - 我正在尝试安装 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.
解决方案
我遇到的问题是我不小心在我的服务器端 NPM 文件夹以及客户端文件夹中安装了材料 ui 核心,因此服务器端 npm 模块正在寻找一个不存在的 react 版本。就这么简单吗?
推荐阅读
- macos - 应用内购买沙盒在 macOS Catalina 上完全崩溃
- powerbi - 如何在 Power BI 中将工作日转换为每天可以多次更新的小时?
- javascript - JSX 中的多个 if/else
- sql - Rmarkdown - 评估或显示 SQL 块的参数化查询
- python - 如何获取 WebElement 的值
- angular - 此客户端应用程序未批准回调 URL。可以在您的应用程序设置中调整已批准的回调 URL
- spring - 不将 EntityManager 标记为 @PersistenceContext 的含义是什么
- elasticsearch - Elasticsearch:在相关分数中使用密集向量的距离(在查询时)
- javascript - 如何使用 Firestore 查询为 javascript 执行基于用户角色的登录
- html - 如何为深色模式加载不同的视频