【问题标题】:React Native Navigation InstallingReact Native Navigation 安装
【发布时间】:2022-12-22 16:16:42
【问题描述】:

以下是安装 React Native Navigation 时的错误。帮我解决这个问题:

npm install -- save react-navigation
npm ERR! code ENOENT
npm ERR! syscall rename
npm ERR! path E:\ReactNative\logwithfirebase\node_modules\@react-navigation\core\node_modules\react-is
npm ERR! dest E:\ReactNative\logwithfirebase\node_modules\@react-navigation\core\node_modules\.react-is.DELETE
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, rename 'E:\ReactNative\logwithfirebase\node_modules\@react-navigation\core\node_modules\react-is' -> 'E:\ReactNative\logwithfirebase\node_modules\@react-navigation\core\node_modules\.react-is.DELETE'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\asadc\AppData\Roaming\npm-cache\_logs\2022-08-09T08_24_34_577Z-debug.log

【问题讨论】:

    标签: react-native


    【解决方案1】:

    这是完整的安装反应本机导航

    通过以下命令安装 React Navigation。 npm install @react-navigation/native 安装后执行以下步骤:

    1.npm install react-native-screens react-native-safe-area-context

    如果这不起作用 从中删除依赖项@react-navigation/native包.json

    请删除您的 node_modules package-lock.json

    并再次遵循相同的过程。

    谢谢!!

    【讨论】:

      【解决方案2】:

      你的意思是运行这个? npm 安装@react-navigation/native

      参考: https://reactnavigation.org/docs/getting-started/

      【讨论】:

      • 是的,在运行 npm install @react-navigation/native 后,它显示错误。
      • 你能告诉我你在终端中运行什么命令吗
      • npm install @react-navigation/native 这是我正在使用的
      【解决方案3】:

      如果你在 mac 上工作,那可能就是原因。你应该跑

      yarn add @react-navigation/native
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2023-03-21
        • 1970-01-01
        • 2019-10-16
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2017-10-24
        • 1970-01-01
        相关资源
        最近更新 更多