ant design pro开发环境搭建

命令行窗口使用管理员身份打开,以免出现其他不可意料的错误

1.  npm create umi

2. 依次选择:

-> ant-design-pro

-> Prov4

->TypeScript

->simple

->antd@4

3. npm install,出错:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: ant-design-pro@4.5.0
npm ERR! Found: react@17.0.1
npm ERR! node_modules/react
npm ERR!   react@"^17.0.0" from the root project
npm ERR!   peer react@">=16.9.0" from antd@4.9.4
npm ERR!   node_modules/antd
npm ERR!     antd@"^4.8.6" from the root project
npm ERR!     peer antd@"4.x" from @ant-design/pro-form@1.10.2
npm ERR!     node_modules/@ant-design/pro-form
npm ERR!       @ant-design/pro-form@"^1.3.0" from the root project
npm ERR!   1 more (react-dom)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.x" from @ant-design/pro-form@1.10.2
npm ERR! node_modules/@ant-design/pro-form
npm ERR!   @ant-design/pro-form@"^1.3.0" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!

问题产生的可能原因以及对应的解决方法:
版本不支持:降低版本
权限不够:
方法一:删除C:\Users{账户}\下的npmrc文件 [未找到]
方法二:使用npm cache clean --force命令清理缓存 [无效]
方法三:使用npm install --save --legacy-peer-deps @material-ui/core命令 [未尝试]

方法四:npm install --legacy-peer-deps [未解决,出现其他错误]

可尝试:删除全局包:npm uninstall -g react,再执行npm install [未尝试]

可尝试:使用yarn来安装 [完美解决]

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 4
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值