【问题标题】:Cannot install node package modules React native无法安装节点包模块 React native
【发布时间】:2022-01-08 21:00:21
【问题描述】:

您好,我删除了我的节点模块文件夹和我的包 lock.json 文件。

在运行npm install 时出现以下错误:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: burp-react-native@1.0.0
npm ERR! Found: prop-types@15.6.2
npm ERR! node_modules/prop-types
npm ERR!   prop-types@"^15.6.2" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer prop-types@"^15.7.2" from react-native-fast-image@6.0.0
npm ERR! node_modules/react-native-fast-image
npm ERR!   react-native-fast-image@"6.0.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! 
npm ERR! See /Users/drive/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/drive/.npm/_logs/2021-12-02T11_01_47_740Z-debug.log

我该如何解决这个问题?有什么想法吗?

【问题讨论】:

  • 试试npm install --legacy-peer-deps

标签: node.js react-native npm


【解决方案1】:

看起来您正在使用 prop-type@15.6.2,而您的一个包 react-native-fast-image 正在使用 prop-type @15.7.2(这是最新的)。尝试将您的道具类型更新为最新的,然后重试。同时你也可以做npm i --force或者npm i --legacy-peer-deps

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-01-08
    • 1970-01-01
    • 2018-06-14
    • 2017-08-03
    • 1970-01-01
    • 2021-11-16
    • 1970-01-01
    • 2019-11-10
    相关资源
    最近更新 更多