如何将react-native裸应用程序转换为expo应用程序?

问题描述 投票:0回答:1

我正在做一个React Native项目,在我来项目之前已经建好了一半。之前的开发团队使用 macOS 进行开发,我有一台 PC - 我也没有经济能力购买一台。

因此,我需要使用 Expo 从笔记本电脑上在手机上运行该项目,以便我可以开始开发。我曾尝试这样做,但显然我做错了。到目前为止我的步骤是:

  1. 创建一个新的expo项目,安装与旧项目相同的依赖项。
  2. 将旧的 src/ 文件夹移动到新项目中。
  3. 将 App.js 内容复制到新的 (expo) App.js 中,并更新导入语句
  4. npx展会开始

这导致我犯了各种各样的错误。我希望这里有人知道如何做到这一点?我在这里非常需要帮助。

我知道这是基本的,所以我很抱歉 - 非常感谢您的回复。

作为参考,这里是 package.json 文件:

{
  "name": "[name]",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "lint": "eslint .",
    "test": "jest",
    "deploy:ios": "firebase \"$IOS_BUNDLE_PATH\" --app \"$FIRE_APP_IOS_ID\" --token \"$FIRE_TOKEN\"",
    "deploy:android": "firebase \"$ANDROID_BUNDLE_PATH\" --app \"$FIRE_APP_ANDROID_ID\" --token \"$FIRE_TOKEN\"",
    "seed": "firestore-seed",
    "copy-env:dev": "echo test",
    "copy-google-services-dev-android": "copy /Y .\\src\\config\\env\\dev\\google-services.json .\\android\\app\\google-services.json",
    "copy-google-services-dev-ios": "cp -Rv ./src/config/env/dev/GoogleService-Info.plist ./ios/2nite/GoogleService-Info.plist",
    "copy-google-services-dev-messaging-key": "cp -Rv ./src/config/env/dev/firebase-messaging-key.json ./src/utils/firebase-messaging-key.json",
    "copy-google-services-dev-dynamic-link-prefix": "cp -Rv ./src/config/env/dev/dynamic-link-prefix.json ./src/utils/firebase/dynamic-link-prefix.json",
    "copy-dev-redux-store-root": "cp -Rv ./src/config/env/dev/redux-store-root.json ./src/redux/redux-store-root.json",
    "copy-google-services:dev": "run-p copy-google-services-dev-* copy-dev-*",
    "copy-stage-files:dev": "run-p copy-google-services:dev copy-env:dev",
    "copy-env:prod": "cp -Rv ./src/config/env/prod/env ./src/.env",
    "copy-google-services-prod-android": "cp -Rv ./src/config/env/prod/google-services.json ./android/app/google-services.json",
    "copy-google-services-prod-ios": "cp -Rv ./src/config/env/prod/GoogleService-Info.plist ./ios/2nite/GoogleService-Info.plist",
    "copy-google-services-prod-messaging-key": "cp -Rv ./src/config/env/prod/firebase-messaging-key.json ./src/utils/firebase-messaging-key.json",
    "copy-google-services-prod-dynamic-link-prefix": "cp -Rv ./src/config/env/prod/dynamic-link-prefix.json ./src/utils/firebase/dynamic-link-prefix.json",
    "copy-prod-redux-store-root": "cp -Rv ./src/config/env/prod/redux-store-root.json ./src/redux/redux-store-root.json",
    "copy-google-services:prod": "run-p copy-google-services-prod-* copy-prod-*",
    "copy-stage-files:prod": "run-p copy-google-services:prod copy-env:prod",
    "prestart": "npm run copy-stage-files:dev",
    "start": "watchman watch-del-all && react-native start --reset-cache",
    "android:dev": "react-native run-android --variant=developmentdebug",
    "android:dev-release": "react-native run-android --variant=developmentrelease",
    "android:prod": "react-native run-android --variant=productiondebug",
    "android:prod-release": "react-native run-android --variant=productionrelease"
  },
  "dependencies": {
    "@bam.tech/react-native-image-resizer": "^3.0.5",
    "@dotmind/rn-shadow-generator": "^1.0.4",
    "@expo/react-native-action-sheet": "^3.9.0",
    "@invertase/react-native-apple-authentication": "^2.2.1",
    "@notifee/react-native": "^7.7.1",
    "@react-native-async-storage/async-storage": "^1.15.5",
    "@react-native-clipboard/clipboard": "^1.11.2",
    "@react-native-community/art": "^1.2.0",
    "@react-native-community/datetimepicker": "^7.1.0",
    "@react-native-community/geolocation": "^3.0.6",
    "@react-native-community/push-notification-ios": "^1.8.0",
    "@react-native-firebase/app": "^14.12.0",
    "@react-native-firebase/auth": "^14.12.0",
    "@react-native-firebase/database": "^14.12.0",
    "@react-native-firebase/dynamic-links": "^14.12.0",
    "@react-native-firebase/firestore": "^14.12.0",
    "@react-native-firebase/functions": "^14.12.0",
    "@react-native-firebase/messaging": "^14.12.0",
    "@react-native-firebase/storage": "^14.12.0",
    "@react-native-masked-view/masked-view": "^0.2.9",
    "@react-native-picker/picker": "^2.4.10",
    "@react-navigation/bottom-tabs": "^5.11.11",
    "@react-navigation/material-bottom-tabs": "^5.3.15",
    "@react-navigation/material-top-tabs": "^5.3.15",
    "@react-navigation/native": "^5.9.4",
    "@react-navigation/stack": "^5.14.5",
    "@stripe/stripe-react-native": "^0.27.2",
    "@twotalltotems/react-native-otp-input": "^1.3.11",
    "axios": "^0.27.2",
    "dayjs": "^1.10.6",
    "deprecated-react-native-prop-types": "^4.1.0",
    "faker": "^6.6.6",
    "geolib": "^3.3.4",
    "global": "^4.4.0",
    "i": "^0.3.7",
    "jetifier": "^2.0.0",
    "lodash": "^4.17.21",
    "moment": "^2.29.3",
    "npm": "^8.19.3",
    "npm-run-all": "^4.1.5",
    "react": "18.2.0",
    "react-native": "0.71.8",
    "react-native-barcode-builder": "^2.0.0",
    "react-native-camera": "^4.2.1",
    "react-native-config": "^1.5.0",
    "react-native-country-picker-modal": "^2.0.0",
    "react-native-element-dropdown": "^1.8.10",
    "react-native-extended-stylesheet": "^0.12.0",
    "react-native-fast-image": "^8.5.11",
    "react-native-fs": "^2.18.0",
    "react-native-geocoding": "^0.5.0",
    "react-native-geolocation-service": "^5.3.0",
    "react-native-gesture-handler": "^2.10.2",
    "react-native-gifted-chat": "^2.4.0",
    "react-native-image-blur-loading": "^1.1.6",
    "react-native-image-crop-picker": "^0.36.2",
    "react-native-image-progress": "^1.2.0",
    "react-native-image-zoom-viewer": "^3.0.1",
    "react-native-keyboard-aware-scroll-view": "^0.9.4",
    "react-native-linear-gradient": "^3.0.0-alpha.1",
    "react-native-maps": "1.8.0",
    "react-native-modal": "^13.0.1",
    "react-native-modal-datetime-picker": "^13.1.2",
    "react-native-otp-textinput": "^1.1.1",
    "react-native-pager-view": "^5.2.1",
    "react-native-paper": "^4.9.2",
    "react-native-parsed-text": "^0.0.22",
    "react-native-permissions": "^3.0.4",
    "react-native-picker-select": "^8.0.4",
    "react-native-progress": "^5.0.0",
    "react-native-push-notification": "^7.4.0",
    "react-native-qrcode-scanner": "^1.5.5",
    "react-native-qrcode-svg": "^6.2.0",
    "react-native-raw-bottom-sheet": "^2.2.0",
    "react-native-reanimated": "3.0.0",
    "react-native-rename": "^3.2.12",
    "react-native-responsive-screen": "^1.4.2",
    "react-native-safe-area-context": "4.5.3",
    "react-native-screens": "^3.4.0",
    "react-native-share": "^6.3.0",
    "react-native-simple-toast": "^1.1.0",
    "react-native-skeleton-placeholder": "^5.2.3",
    "react-native-smooth-pincode-input": "^1.0.9",
    "react-native-snap-carousel": "^3.9.1",
    "react-native-splash-screen": "^3.2.0",
    "react-native-svg": "13.9.0",
    "react-native-svg-transformer": "1.1.0",
    "react-native-swiper-flatlist": "^3.0.16",
    "react-native-tab-view": "^3.0.1",
    "react-native-vector-icons": "^9.2.0",
    "react-redux": "^7.2.4",
    "redux-logger": "^3.0.6",
    "redux-persist": "^6.0.0",
    "use-debounce": "^9.0.4"
  },
  "devDependencies": {
    "@babel/core": "^7.20.0",
    "@babel/preset-env": "^7.20.0",
    "@babel/runtime": "^7.20.0",
    "@react-native-community/eslint-config": "^3.2.0",
    "@tsconfig/react-native": "^2.0.2",
    "@types/jest": "^29.2.1",
    "@types/react": "^18.0.24",
    "@types/react-test-renderer": "^18.0.0",
    "babel-jest": "^29.2.1",
    "eslint": "^8.19.0",
    "firebase-tools": "^9.13.1",
    "firestore-seed": "^0.0.11",
    "jest": "^29.2.1",
    "metro-config": "^0.66.0",
    "metro-react-native-babel-preset": "0.73.9",
    "prettier": "^2.4.1",
    "react-test-renderer": "18.2.0",
    "typescript": "4.8.4"
  },
  "jest": {
    "preset": "react-native"
  },
  "firestore-seed": {
...
  },
  "reactNativePermissionsIOS": [
    "Camera",
    "PhotoLibrary",
    "PhotoLibraryAddOnly"
  ]
}

react-native expo
1个回答
0
投票

我建议遵循以下文档。

为了简化,您应该运行此命令,它将安装

Expo
包及其所有依赖项。

展会报价:

在大多数情况下,您只需在项目目录中执行以下命令来安装包即可

npx install-expo-modules@latest
© www.soinside.com 2019 - 2024. All rights reserved.