【问题标题】:npm WARN jest-react-native@17.0.0 requires a peer of whatwg-fetch@^1.0.0 but none was installednpm WARN jest-react-native@17.0.0 需要 whatwg-fetch@^1.0.0 的对等点,但没有安装
【发布时间】:2017-04-01 23:33:13
【问题描述】:

当我尝试在 ReactNative 项目中运行 npm install 时,我收到了这个错误。为了解决这个问题,我尝试安装 whatwg-fetch@^1.0.0 但同样的错误。

UNMET PEER DEPENDENCY whatwg-fetch@2.0.1

npm WARN jest-react-native@17.0.0 requires a peer of whatwg-fetch@^1.0.0 but none was installed.
npm ERR! code 1

【问题讨论】:

    标签: android reactjs npm react-native


    【解决方案1】:

    您需要手动安装缺少的对等依赖项
    npm install whatwg-fetch@^1.0.0 --save

    【讨论】:

    • 它有效,但我使用: npm install whatwg-fetch@^1.0 --save 使用 npm install whatwg-fetch@^1.0.whatwg-fetch@^1.0.0 --save 给出错误跨度>
    • 抱歉,我的回答中出现了复制粘贴错误
    • --save 是做什么的?为什么npm install whatwg-fetch@^1.0.0 没有像我之前那样解决问题?
    猜你喜欢
    • 1970-01-01
    • 2016-03-09
    • 2017-09-10
    • 2019-06-03
    • 2016-12-07
    • 2017-04-09
    • 2017-12-18
    • 2018-02-13
    • 2019-02-20
    相关资源
    最近更新 更多