ionic-team / ionic-cli

The Ionic command-line interface
MIT License
2k stars 651 forks source link

Cant run ionic cordova emulate android #2171

Closed nivida closed 7 years ago

nivida commented 7 years ago

What version of the CLI are you using? Output of ionic --version

3.0.0-beta10

Short description of the problem:

I got this error:

{ Error: Failed to transpile program
    at BuildError.Error (native)
    at new BuildError (/Users/Sam/Documents/BadenfahrtAPP/node_modules/@ionic/app-scripts/dist/util/errors.js:16:28)
    at /Users/Sam/Documents/BadenfahrtAPP/node_modules/@ionic/app-scripts/dist/transpile.js:137:20
    at transpileWorker (/Users/Sam/Documents/BadenfahrtAPP/node_modules/@ionic/app-scripts/dist/transpile.js:103:12)
    at Object.transpile (/Users/Sam/Documents/BadenfahrtAPP/node_modules/@ionic/app-scripts/dist/transpile.js:61:12)
    at buildProject (/Users/Sam/Documents/BadenfahrtAPP/node_modules/@ionic/app-scripts/dist/build.js:97:78)
    at /Users/Sam/Documents/BadenfahrtAPP/node_modules/@ionic/app-scripts/dist/build.js:47:16 hasBeenLogged: false, isFatal: false, name: 'Error' }

What behavior are you expecting?

The Emulator should start

Steps to reproduce: Update cli

Package.json:

{
  "name": "ionic-app-base",
  "author": "Ionic Framework",
  "homepage": "http://ionicframework.com/",
  "private": true,
  "scripts": {
    "clean": "ionic-app-scripts clean",
    "build": "ionic-app-scripts build",
    "ionic:build": "ionic-app-scripts build",
    "ionic:serve": "ionic-app-scripts serve"
  },
  "dependencies": {
    "@angular/common": "4.0.2",
    "@angular/compiler": "4.0.2",
    "@angular/compiler-cli": "4.0.2",
    "@angular/core": "4.0.2",
    "@angular/forms": "4.0.2",
    "@angular/http": "4.0.2",
    "@angular/platform-browser": "4.0.2",
    "@angular/platform-browser-dynamic": "4.0.2",
    "@angular/platform-server": ">=2.2.1",
    "@ionic-native/core": "^3.6.0",
    "@ionic-native/in-app-browser": ">=3.5.0",
    "@ionic-native/splash-screen": "3.4.2",
    "@ionic-native/status-bar": "3.4.2",
    "@ionic/storage": "2.0.1",
    "angularfire2": ">=2.0.0-beta.5",
    "firebase": ">=3.6.1",
    "ionic-angular": "3.1.0",
    "ionic-native": ">=2.4.1",
    "ionicons": "3.0.0",
    "rxjs": "5.1.1",
    "sw-toolbox": "3.4.0",
    "zone.js": "^0.8.5"
  },
  "devDependencies": {
    "@ionic/app-scripts": "1.3.6",
    "typescript": "~2.2.1",
    "@ionic/cli-plugin-cordova": "^1.0.0-beta1",
    "@ionic/cli-plugin-ionic-angular": "^1.0.0-beta1",
    "@types/jasmine": ">=2.5.38",
    "cordova-plugin-device": ">=1.1.3",
    "cordova-plugin-fcm": ">=1.1.5",
    "cordova-plugin-mauron85-background-geolocation": ">=2.2.5"
  },
  "cordovaPlugins": [
    "cordova-plugin-firebase",
    "cordova-plugin-whitelist",
    "cordova-plugin-statusbar",
    "cordova-plugin-splashscreen",
    "cordova-sqlite-ext",
    "cordova-plugin-background-mode",
    "cordova-plugin-device",
    "cordova-plugin-network-information",
    {
      "locator": "https://github.com/driftyco/cordova-plugin-wkwebview-engine.git",
      "id": "cordova-plugin-wkwebview-engine"
    },
    "cordova-plugin-inappbrowser",
    {
      "locator": "https://github.com/litehelpers/Cordova-sqlite-storage.git",
      "id": "cordova-sqlite-storage"
    },
    "cordova-plugin-dbcopy",
    "com-sarriaroman-photoviewer"
  ],
  "cordovaPlatforms": [
    {
      "platform": "ios",
      "version": "",
      "locator": "ios"
    },
    {
      "platform": "android",
      "version": "",
      "locator": "android"
    }
  ],
  "description": "Badenfahrt 2017"
}

npm (global):

@ionic/cli-utils : 1.0.0-beta1
cordova          : 6.5.0
ionic            : 3.0.0-beta10

npm (local):

@ionic/app-scripts              : 1.3.6
@ionic/cli-plugin-cordova       : 1.0.0-beta1
@ionic/cli-plugin-ionic-angular : 1.0.0-beta1
Ionic Framework                 : ionic-angular 3.1.0

System:

Node       : v6.9.1
OS         : macOS Sierra
Xcode      : Xcode 8.3.2 Build version 8E2002
ios-deploy : 1.9.0
ios-sim    : 5.0.11
janpio commented 7 years ago

Does it work with CLI 2.2.3 or is this a problem with your project?

nivida commented 7 years ago

it was working yesterday with cli 3.0 and this morning it has given some updates and now it is broken this modules below have i updated and after this update i have some other errors but i have found a solution for this errors.. ionic native core update to 3.6.0 and since this i have the transpile error.

npm install --save-dev @ionic/cli-plugin-cordova@beta @ionic/cli-plugin-ionic-angular@beta

nivida commented 7 years ago

Okay the transpile error was because of my.. and now it cant find ionic-native

janpio commented 7 years ago

You have two versions of Ionic Native in your package.json:

"@ionic-native/core": "^3.6.0",

and

"ionic-native": ">=2.4.1",

You probably want to get rif of the older one.

nivida commented 7 years ago

Hmm okay i have edit my package json.. deleted the node modules dir and have run npm install.. after this i have that error: Module not found: Error: Can't resolve 'ionic-native'

janpio commented 7 years ago

Then you haven't updated all your Ionic Native imports to 2.4.1 yet. Look at the current documentation what it should look like. (I think there was a "how to upgrade" post somewhere, but I can't find it right now. Sorry)

janpio commented 7 years ago

👍