Ionic 如何运行五年内从未更新的离子应用程序

gmxoilav  于 2023-09-28  发布在  Ionic
关注(0)|答案(2)|浏览(137)

上周我的小队给予了我一个很大的使命。运行一个5年前用ionic angular创建的应用程序
问题是给定的项目在五年内从未更新。我不知道如何运行这个应用程序,因为我尝试的一切都失败了

{
  "name": "appname",
  "version": "0.0.1",
  "author": "Ionic Framework",
  "homepage": "https://ionicframework.com/",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular/common": "^7.2.2",
    "@angular/core": "^7.2.2",
    "@angular/forms": "^7.2.2",
    "@angular/http": "^7.2.2",
    "@angular/platform-browser": "^7.2.2",
    "@angular/platform-browser-dynamic": "^7.2.2",
    "@angular/router": "^7.2.2",
    "@ionic-native/camera": "^5.5.1",
    "@ionic-native/core": "^5.10.0",
    "@ionic-native/device": "^5.5.1",
    "@ionic-native/fcm": "^5.15.1",
    "@ionic-native/file": "^5.10.0",
    "@ionic-native/file-path": "^5.5.1",
    "@ionic-native/file-transfer": "^5.10.0",
    "@ionic-native/geolocation": "^5.5.1",
    "@ionic-native/in-app-browser": "^5.5.1",
    "@ionic-native/native-page-transitions": "^5.12.0",
    "@ionic-native/network": "^5.5.1",
    "@ionic-native/qr-scanner": "^5.5.1",
    "@ionic-native/splash-screen": "^5.0.0",
    "@ionic-native/sqlite": "^5.5.1",
    "@ionic-native/status-bar": "^5.0.0",
    "@ionic-native/transfer": "^3.14.0",
    "@ionic/angular": "^4.11.10",
    "cordova": "^8.1.0",
    "cordova-android": "^7.1.4",
    "cordova-browser": "6.0.0",
    "cordova-ios": "^4.5.5",
    "cordova-plugin-add-swift-support": "^2.0.2",
    "cordova-plugin-camera": "4.0.3",
    "cordova-plugin-device": "2.0.2",
    "cordova-plugin-file": "6.0.1",
    "cordova-plugin-file-transfer": "1.7.1",
    "cordova-plugin-filepath": "1.5.4",
    "cordova-plugin-geolocation": "4.0.1",
    "cordova-plugin-inappbrowser": "3.0.0",
    "cordova-plugin-ionic": "^5.4.0",
    "cordova-plugin-ionic-keyboard": "^2.1.3",
    "cordova-plugin-ionic-webview": "^4.0.1",
    "cordova-plugin-network-information": "2.0.1",
    "cordova-plugin-qrscanner": "3.0.1",
    "cordova-plugin-splashscreen": "^5.0.2",
    "cordova-plugin-statusbar": "^2.4.2",
    "cordova-plugin-whitelist": "^1.3.3",
    "cordova-sqlite-storage": "3.2.0",
    "core-js": "^2.5.4",
    "ionic": "^4.2.1",
    "rxjs": "^6.5.2",
    "rxjs-compat": "^6.5.2",
    "sass": "^1.66.1",
    "transfer": "1.0.7",
    "ts-md5": "^1.2.4",
    "tslib": "^1.9.0",
    "zone.js": "~0.8.29"
  },
  "devDependencies": {
    "@angular-devkit/architect": "~0.13.8",
    "@angular-devkit/build-angular": "^0.13.9",
    "@angular-devkit/core": "~7.3.8",
    "@angular-devkit/schematics": "~7.3.8",
    "@angular/cli": "7.3.9",
    "@angular/compiler": "~7.2.2",
    "@angular/compiler-cli": "~7.2.2",
    "@angular/language-service": "~7.2.2",
    "@ionic/angular-toolkit": "~1.5.1",
    "@ionic/app-scripts": "^3.2.4",
    "@types/jasmine": "~2.8.8",
    "@types/jasminewd2": "~2.0.3",
    "@types/node": "~12.0.0",
    "codelyzer": "~4.5.0",
    "jasmine-core": "~2.99.1",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~4.1.0",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "~2.0.1",
    "karma-jasmine": "~1.1.2",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "~5.4.0",
    "ts-node": "~8.1.0",
    "tslint": "~5.16.0",
    "typescript": "~3.1.6"
  },
  "description": "An Ionic project",
  "cordova": {
    "plugins": {
      "cordova-plugin-camera": {},
      "cordova-plugin-device": {},
      "cordova-plugin-file": {},
      "cordova-plugin-filepath": {},
      "cordova-plugin-geolocation": {},
      "cordova-plugin-network-information": {},
      "cordova-plugin-qrscanner": {},
      "cordova-sqlite-storage": {},
      "cordova-plugin-whitelist": {},
      "cordova-plugin-statusbar": {},
      "cordova-plugin-splashscreen": {},
      "cordova-plugin-ionic-webview": {
        "ANDROID_SUPPORT_ANNOTATIONS_VERSION": "27.+"
      },
      "cordova-plugin-ionic-keyboard": {},
      "cordova-plugin-file-transfer": {},
      "cordova-plugin-inappbrowser": {},
      "cordova-plugin-ionic": {
        "APP_ID": "1ce2ba10",
        "CHANNEL_NAME": "Master",
        "UPDATE_METHOD": "background",
        "UPDATE_API": "https://api.ionicjs.com",
        "MAX_STORE": "2",
        "MIN_BACKGROUND_DURATION": "30"
      },
      "cordova-plugin-fcm-with-dependecy-updated": {
        "FCM_CORE_VERSION": "16.0.9",
        "FCM_VERSION": "18.0.0",
        "GRADLE_TOOLS_VERSION": "3.5.0",
        "GOOGLE_SERVICES_VERSION": "4.2.0"
      },
      "cordova-plugin-fcm": {}
    },
    "platforms": [
      "browser",
      "android"
    ]
  }
}

有人能帮帮我吗?我应该使用哪个版本的ionic、node等来运行这个应用程序?我对爱奥尼亚的发展有起码的了解。

wixjitnu

wixjitnu1#

你需要做很多功课,这对新人来说并不容易。没有如何构建/运行旧离子项目的指南。下面是一些步骤,让你开始:

  • 项目在ionic 4上,您需要查看ionic 4版本的ionic github repo,并检查最小节点和npm要求。
  • 在了解了以上内容之后,现在您需要nvm,n或homebrew来切换回旧版本的node和npm。因为新版本不能在旧项目上工作。
  • 然后尝试构建/运行项目:
  • npm i
  • ionic build
  • ionic cordova build [platform]
  • ionic cordova run [platform]

很多错误将表明需要修复,但至少你有基本的下来。祝你好运!

fkvaft9z

fkvaft9z2#

cordova项目最大的问题是插件的故障排除,而ionic的问题是更新和配置新的东西,因为ionic插件经常更新。运行应用程序并配置java jdk和android sdk是创建环境的第一步,请确保更新和配置gradle以进行构建。我建议找出其中一个离子/ cordova 版本正在运行,并为java和android sdk/jdk运行设置,之后执行android更新和故障排除,直到可部署到商店。

相关问题