【问题标题】:Installing ant design with npm使用 npm 安装 ant design
【发布时间】:2017-05-16 13:20:42
【问题描述】:

我正在尝试在我的项目中安装 ant design。 npm install antd --save

导致以下警告:

npm WARN react-lazy-load@3.0.12 requires a peer of react@^0.14.0 || ^15.0.0-0 but none was installed.
npm WARN react-lazy-load@3.0.12 requires a peer of react-dom@^0.14.0 || ^15.0.0-0 but none was installed.
npm WARN react-slick@0.14.11 requires a peer of react@^0.14.0 || ^15.0.1 but none was installed.
npm WARN react-slick@0.14.11 requires a peer of react-dom@^0.14.0 || ^15.0.1 but none was installed.
npm WARN draft-js@0.10.1 requires a peer of react@^0.14.0 || ^15.0.0-rc but none was installed.
npm WARN draft-js@0.10.1 requires a peer of react-dom@^0.14.0 || ^15.0.0-rc but none was installed.
npm WARN rc-hammerjs@0.6.6 requires a peer of react@^0.14.3 || ^15.0.0 but none was installed.

在我可以看到的依赖关系中:

"@types/react": "15.0.24",
"@types/react-dom": "15.5.0",

这是否意味着 ant design 与这些版本的 react 不兼容?我究竟做错了什么?有什么建议么?

【问题讨论】:

  • @types/react@types/react-dom 是 TypeScript 定义 (npmjs.com/~types)。您收到 npm WARN,这不是错误。你试过用 antd 包看看有没有报错吗?
  • 对不起,我可能误读了那里的内容,尽管我在尝试运行命令时收到了这些消息。我是新手,所以我可能在这个话题上错了。一旦我深入挖掘,我会更新问题

标签: node.js webpack widget visual-studio-code


【解决方案1】:

你有一个旧版本的 react 还不支持 ant-design。尝试安装最新版本的 react。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-10-22
    • 1970-01-01
    • 2019-10-28
    • 2020-03-11
    • 2016-07-04
    • 2014-05-30
    • 2021-06-05
    • 2016-03-26
    相关资源
    最近更新 更多