ionic-team / ionic-framework

A powerful cross-platform UI toolkit for building native-quality iOS, Android, and Progressive Web Apps with HTML, CSS, and JavaScript.
https://ionicframework.com
MIT License
50.91k stars 13.52k forks source link

bug: #21952

Closed fredroo closed 4 years ago

fredroo commented 4 years ago

Bug Report

[x] 5.4.16

Current behavior: return error

2130cb18-b1c0-4e0a-a655-ae5b497ad073 Expected behavior: build successfully and run on browser Steps to reproduce: ionic serve Related code:

{
  "name": "",
  "description": "",
  "version": "0.0.1",
  "author": "",
  "homepage": "",
  "private": true,
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "config": {
    "ionic_webpack": "./config/webpack.config.js"
  },
  "dependencies": {
    "@agm/core": "^3.0.0-beta.0",
    "@angular/animations": "~10.0.0",
    "@angular/common": "~10.0.0",
    "@angular/compiler": "~10.0.0",
    "@angular/compiler-cli": "~10.0.0",
    "@angular/core": "^10.0.11",
    "@angular/forms": "~10.0.0",
    "@angular/http": "~7.2.16",
    "@angular/platform-browser": "~10.0.0",
    "@angular/platform-browser-dynamic": "~10.0.0",
    "@angular/router": "~10.0.0",
    "@angular/tsc-wrapped": "*",
    "@auth0/angular-jwt": "^5.0.1",
    "@capacitor/android": "^2.4.0",
    "@capacitor/core": "2.2.0",
    "@capacitor/ios": "^2.4.0",
    "@ionic-native/card-io": "^5.28.0",
    "@ionic-native/core": "^5.28.0",
    "@ionic-native/device": "^4.20.0",
    "@ionic-native/email-composer": "^4.20.0",
    "@ionic-native/facebook": "^5.28.0",
    "@ionic-native/file": "^5.28.0",
    "@ionic-native/file-chooser": "^5.28.0",
    "@ionic-native/file-transfer": "^5.28.0",
    "@ionic-native/geolocation": "^4.20.0",
    "@ionic-native/globalization": "^5.28.0",
    "@ionic-native/google-analytics": "^5.28.0",
    "@ionic-native/google-maps": "^5.5.0",
    "@ionic-native/google-plus": "^4.20.0",
    "@ionic-native/ionic-webview": "^5.28.0",
    "@ionic-native/keyboard": "^5.28.0",
    "@ionic-native/native-geocoder": "^4.20.0",
    "@ionic-native/network": "^4.20.0",
    "@ionic-native/paypal": "^4.20.0",
    "@ionic-native/social-sharing": "^4.20.0",
    "@ionic-native/splash-screen": "^5.0.0",
    "@ionic-native/status-bar": "^5.0.0",
    "@ionic-native/toast": "^4.5.2",
    "@ionic-native/twitter-connect": "^5.28.0",
    "@ionic/angular": "^5.3.1",
    "@ionic/core": "^5.3.1",
    "@ionic/storage": "^2.3.0",
    "@ngx-translate/core": "^13.0.0",
    "@ngx-translate/http-loader": "^0.1.0",
    "@types/google.analytics": "0.0.40",
    "android-versions": "^1.5.0",
    "angular2-text-mask": "^9.0.0",
    "autoprefixer": "^7.2.3",
    "capacitor-twitter": "^2.0.0",
    "card.io.cordova.mobilesdk": "^2.1.0",
    "com.paypal.cordova.mobilesdk": "^3.5.0",
    "cordova": "^9.0.0",
    "cordova-android": "^7.1.4",
    "cordova-androidx-build": "^1.0.4",
    "cordova-plugin-add-swift-support": "^2.0.2",
    "cordova-plugin-device": "^2.0.3",
    "cordova-plugin-email": "^1.2.7",
    "cordova-plugin-email-composer": "git+https://github.com/katzer/cordova-plugin-email-composer.git",
    "cordova-plugin-facebook4": "^5.0.0",
    "cordova-plugin-file": "^6.0.2",
    "cordova-plugin-file-transfer": "^1.7.1",
    "cordova-plugin-filechooser": "^1.2.0",
    "cordova-plugin-geolocation": "^3.0.0",
    "cordova-plugin-globalization": "^1.11.0",
    "cordova-plugin-google-analytics": "^1.9.0",
    "cordova-plugin-googlemaps": "git+https://github.com/mapsplugin/cordova-plugin-googlemaps.git#multiple_maps",
    "cordova-plugin-googlemaps-sdk": "git+https://github.com/mapsplugin/cordova-plugin-googlemaps-sdk.git#2.7.0",
    "cordova-plugin-googleplus": "^7.0.2",
    "cordova-plugin-ionic-keyboard": "^2.2.0",
    "cordova-plugin-ionic-webview": "^1.2.1",
    "cordova-plugin-nativegeocoder": "^3.4.1",
    "cordova-plugin-network-information": "^1.3.4",
    "cordova-plugin-splashscreen": "^5.0.4",
    "cordova-plugin-statusbar": "^2.4.3",
    "cordova-plugin-whitelist": "^1.3.4",
    "cpf_cnpj": "^0.2.0",
    "crypto-md5": "*",
    "es6-promise-plugin": "^4.2.2",
    "ionic": "^5.4.16",
    "ionic-angular": "^3.9.10",
    "ionicons": "3.0.0",
    "jquery-mask-plugin": "^1.14.16",
    "jquery-maskmoney": "^3.0.2",
    "minimist": "^1.2.5",
    "moment": "^2.27.0",
    "npm": "^6.14.8",
    "numeral": "^2.0.6",
    "rxjs": "^6.6.2",
    "rxjs-compat": "^6.6.2",
    "scriptjs": "^2.5.8",
    "sw-toolbox": "3.6.0",
    "text-mask-addons": "*",
    "tslib": "^2.0.0",
    "twitter-connect-plugin": "^0.6.0",
    "xml2js": "^0.4.23",
    "zone.js": "~0.10.3"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~0.1000.0",
    "@angular/cli": "~10.0.7",
    "@angular/compiler": "~10.0.0",
    "@angular/compiler-cli": "~10.0.0",
    "@angular/language-service": "~10.0.0",
    "@capacitor/cli": "2.4.0",
    "@ionic/angular-toolkit": "^2.3.1",
    "@ionic/app-scripts": "3.2.4",
    "@ionic/lab": "2.0.7",
    "@types/googlemaps": "^3.39.13",
    "@types/jasmine": "~3.5.0",
    "@types/jasminewd2": "~2.0.3",
    "@types/node": "^12.11.1",
    "codelyzer": "^6.0.0",
    "jasmine-core": "~3.5.0",
    "jasmine-spec-reporter": "~5.0.0",
    "karma": "~5.0.0",
    "karma-chrome-launcher": "~3.1.0",
    "karma-coverage-istanbul-reporter": "~3.0.2",
    "karma-jasmine": "~3.3.0",
    "karma-jasmine-html-reporter": "^1.5.0",
    "protractor": "~7.0.0",
    "ts-node": "~8.3.0",
    "tslint": "~6.1.0",
    "typescript": "^4.0.2"
  },
  "cordova": {
    "plugins": {
      "cordova-plugin-device": {},
      "cordova-plugin-ionic-keyboard": {},
      "cordova-plugin-ionic-webview": {},
      "cordova-plugin-splashscreen": {},
      "cordova-plugin-statusbar": {},
      "cordova-plugin-whitelist": {},
      "com.paypal.cordova.mobilesdk": {},
      "cordova-plugin-email": {},
      "cordova-plugin-geolocation": {},
      "cordova-plugin-email-composer": {
        "ANDROID_SUPPORT_V4_VERSION": "27.+"
      },
      "cordova-plugin-google-analytics": {
        "GMS_VERSION": "11.0.1"
      },
      "cordova-plugin-x-socialsharing": {
        "ANDROID_SUPPORT_V4_VERSION": "24.1.1+"
      },
      "cordova-plugin-googlemaps": {
        "API_KEY_FOR_ANDROID": "",
        "API_KEY_FOR_IOS": "",
        "LOCATION_WHEN_IN_USE_DESCRIPTION": "Show your location on the map",
        "LOCATION_ALWAYS_USAGE_DESCRIPTION": "Trace your location on the map",
        "PLAY_SERVICES_VERSION": "15.0.1",
        "ANDROID_SUPPORT_V4_VERSION": "27.+"
      },
      "cordova-plugin-network-information": {},
      "cordova-plugin-file-transfer": {},
      "cordova-plugin-filechooser": {},
      "cordova-plugin-nativegeocoder": {},
      "cordova-plugin-facebook4": {
        "APP_ID": "",
        "APP_NAME": "",
        "FACEBOOK_HYBRID_APP_EVENTS": "false",
        "FACEBOOK_ANDROID_SDK_VERSION": "5.0.2"
      },
      "cordova-plugin-googleplus": {
        "REVERSED_CLIENT_ID": "",
        "WEB_APPLICATION_CLIENT_ID": "",
        "PLAY_SERVICES_VERSION": "15.0.1"
      },
      "cordova-plugin-globalization": {}
    },
    "platforms": [
      "android",
      "ios",
      "browser"
    ]
  }
}

Other information:

Ionic info:

ionic info

Ionic:

   Ionic CLI          : 5.4.16
   Ionic Framework    : ionic-angular 3.9.10
   @ionic/app-scripts : 3.2.4

Capacitor:

   Capacitor CLI   : 2.4.0
   @capacitor/core : 2.2.0

Cordova:

   Cordova CLI       : 9.0.0 (cordova-lib@9.0.1)
   Cordova Platforms : none
   Cordova Plugins   : no whitelisted plugins (0 plugins total)

Utility:

   cordova-res : 0.15.1
   native-run  : 1.0.0

System:

   NodeJS : v12.18.1 (C:\Program Files\nodejs\node.exe)
   npm    : 6.14.8
   OS     : Windows 10
liamdebeasi commented 4 years ago

Thanks for the issue. You have multiple versions of Ionic Framework installed.

The ionic-angular dependency is Ionic Framework v3 and not compatible with newer versions of Angular. The @ionic/angular dependency is Ionic Framework v5+ and compatible with newer versions of Angular.

If you want to use newer versions of Angular, you will need to upgrade your Ionic app to Ionic Framework v5+

fredroo commented 4 years ago

@liamdebeasi thanks the same error after uninstall ionic-angular take a look on build error ionic build

ionic-app-scripts.cmd build [16:19:50] ionic-app-scripts 3.2.4 [16:19:50] build dev started ... [16:19:50] ionic-app-script task: "build" [16:19:50] Error: ENOENT: no such file or directory, open 'C:\xampp\htdocs\app-reciklado-ionic\node_modules\ionic-angular\package.json' Error: ENOENT: no such file or directory, open 'C:\xampp\htdocs\app-reciklado-ionic\node_modules\ionic-angular\package.json' [ERROR] An error occurred while running subprocess ionic-app-scripts.

    ionic-app-scripts.cmd build exited with exit code 1.

    Re-running this command with the --verbose flag may provide more information.
liamdebeasi commented 4 years ago

Please see our migration guide: https://ionicframework.com/docs/reference/migration#migrating-from-ionic-3-0-to-ionic-4-0

When migrating to Ionic Framework 4.0+ you should not be using ionic-app-scripts. For any issues you may run into while migrating, I recommend you post on the Ionic Forums. This GitHub issue tracker is not intended for support questions. Thanks!

ionitron-bot[bot] commented 3 years ago

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.