我已经使用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.
答案 0 :(得分:0)
您尚未安装react,并且您没有package.json
文件
您应该将此步骤放在同一个目录中:
npm install create-react-app --save -g
creacte-react-app .
npm install @material-ui/core