React Native 无法解析模块 expo-modules-core - Creative Tim Argon UI KIT

Fou*_*oub 14 react-native expo

我尝试安装https://www.creative-tim.com/product/argon-pro-react-native,这是 Creative Tim 的 React Native 模板。我按照所有步骤操作,当我启动 Expo Go 时,出现以下错误:

无法从 /Users/MYNAMES/Desktop/argon-pro-react-native-v1.6.0/node_modules/expo-splash-screen/build/SplashScreen.js 解析模块 expo-modules-core:expo-modules-core 无法可以在项目中找到。

If you are sure the module exists, try these steps:
1. Clear watchman watches: watchman watch-del-all
2. Delete node_modules and run yarn install
3. Reset Metro's cache: yarn start --reset-cache
4. Remove the cache: rm -rf /tmp/metro-*
Run Code Online (Sandbox Code Playgroud)

当我签入node_modules时,文件SplashScreen.js存在。但是 expo-modules-core,我不知道它到底应该在哪里?

这是我的 package.json

{
  "name": "argon-pro-react-native",
  "version": "1.6.0",
  "description": "Argon Pro React Native, based on Argon Design System. Coded by Creative Tim",
  "main": "node_modules/expo/AppEntry.js",
  "scripts": {
    "start": "expo start",
    "android": "expo start --android",
    "ios": "expo start --ios",
    "eject": "expo eject"
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/creativetimofficial/argon-pro-react-native.git"
  },
  "dependencies": {
    "@react-native-community/masked-view": "0.1.10",
    "@react-navigation/bottom-tabs": "^5.5.1",
    "@react-navigation/compat": "^5.1.25",
    "@react-navigation/drawer": "5.12.4",
    "@react-navigation/native": "5.9.3",
    "@react-navigation/stack": "5.14.3",
    "expo": "^40.0.0",
    "expo-app-loading": "^1.0.1",
    "expo-asset": "~8.2.1",
    "expo-font": "~8.4.0",
    "galio-framework": "^0.7.1",
    "prop-types": "^15.7.2",
    "react": "16.13.1",
    "react-native": "https://github.com/expo/react-native/archive/sdk-40.0.1.tar.gz",
    "react-native-gesture-handler": "~1.8.0",
    "react-native-modal-dropdown": "git+https://github.com/siemiatj/react-native-modal-dropdown.git",
    "react-native-reanimated": "~1.13.0",
    "react-native-safe-area-context": "3.1.9",
    "react-native-screens": "~2.15.2"
  },
  "devDependencies": {
    "babel-preset-expo": "8.3.0"
  },
  "keywords": [
    "argon react native",
    "argon design system",
    "argon app react native",
    "argon iOS",
    "react native iOS",
    "creative tim",
    "argon Android",
    "react native ui kit",
    "react native expo",
    "freebie",
    "react native argon design",
    "react native galio",
    "galio argon pro",
    "galio react native free app",
    "argon expo react native",
    "react native ui template"
  ],
  "author": "Creative Tim <hello@creative-tim.com> (https://www.creative-tim.com/)",
  "bugs": {
    "url": "https://github.com/creativetimofficial/ct-argon-pro-react-native/issues"
  },
  "homepage": "https://demos.creative-tim.com/argon-pro-react-native"
}
Run Code Online (Sandbox Code Playgroud)

所以我阻止了这个错误。我已经尝试了第 4 步(清除守望者等)

小智 25

我在 Udemy 上学习 React Native 课程时遇到了同样的错误消息,它似乎与 Expo 改变其模块的安装方式有关。

在我的终端上运行此命令解决了这个问题:

expo install expo-modules-core
Run Code Online (Sandbox Code Playgroud)

  • 这个对我有用。谢谢 ! (2认同)