我正在尝试安装Material-UI,但始终收到以下错误列表:

时间:2019-10-08 17:26:21

标签: reactjs

我已经使用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.

1 个答案:

答案 0 :(得分:0)

您尚未安装react,并且您没有package.json文件 您应该将此步骤放在同一个目录中:

  1. npm install create-react-app --save -g
  2. creacte-react-app .
  3. npm install @material-ui/core