【问题标题】:Expo says react-native is missing世博会说 react-native 缺失
【发布时间】:2019-07-11 23:19:14
【问题描述】:

我通过运行使用 facebook 指南安装了 expo

    npm install -g expo-cli
    npm install react-navigation
    expo start

但它仍然说

npm WARN @react-native-community/netinfo@2.0.10 requires a peer of react-native@>=0.57 <0.60 but none is installed. You must install peer dependencies yourself.
npm WARN react-google-maps@9.4.5 requires a peer of @types/googlemaps@^3.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN react-google-maps@9.4.5 requires a peer of @types/markerclustererplus@^2.1.29 but none is installed. You must install peer dependencies yourself.
npm WARN react-google-maps@9.4.5 requires a peer of @types/react@^15.0.0 || ^16.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN react-native-reanimated@1.0.1 requires a peer of react@16.0.0-alpha.6 but none is installed. You must install peer dependencies yourself.
npm WARN react-native-reanimated@1.0.1 requires a peer of react-native@^0.44.1 but none is installed. You must install peer dependencies yourself.
npm WARN react-native-webview@5.8.1 requires a peer of react-native@>=0.57 <0.60 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

我试图删除我的 node_modules 文件夹并在我的项目目录中重新运行 npm install

它仍然说 react-native not found,虽然正在运行

    react-native -v

在命令行中,显示

    react-native-cli: 2.0.1
    react-native: 0.60.3

【问题讨论】:

  • 你的package.json是什么?

标签: react-native


【解决方案1】:

实际上你只安装 expo-cli 而不是 react native cli ,即使你的 package.json 有 react-native 它也不能从你的 cli 访问。所以你必须单独安装 react-native-cli 才能访问 react-native。

npm install –g react-native-cli

【讨论】:

    猜你喜欢
    • 2023-02-17
    • 1970-01-01
    • 2022-12-05
    • 2023-04-09
    • 2018-08-04
    • 1970-01-01
    • 2021-03-21
    • 1970-01-01
    • 2023-02-25
    相关资源
    最近更新 更多