错误无法解析package.json

时间:2018-02-04 07:07:24

标签: javascript json ionic-framework ionic3

我最近使用soucetree合并了两个2提交,这发生了。我已经删除了< - HEAD,=====及其来源,但它仍然无效。我已经花了将近一天的时间来找到为什么它无法运行离子应用程序的答案。

我最近使用soucetree合并了两个2提交,这发生了。我已经删除了< - HEAD,=====及其来源,但它仍然无效。我已经花了将近一天的时间来找到为什么它无法运行离子应用程序的答案。

enter image description here

附件是我的package.JSON

{
  "name": "devdactic-simpleLogin",
  "version": "0.0.1",
  "author": "Ionic Framework",
  "homepage": "http://ionicframework.com/",
  "private": true,
  "scripts": {
    "clean": "ionic-app-scripts clean",
    "build": "ionic-app-scripts build",
    "lint": "ionic-app-scripts lint",
    "ionic:build": "ionic-app-scripts build",
    "ionic:serve": "ionic-app-scripts serve"
  },
  "dependencies": {
    "@angular/common": "4.1.2",
    "@angular/compiler": "4.1.2",
    "@angular/compiler-cli": "4.1.2",
    "@angular/core": "4.1.2",
    "@angular/forms": "4.1.2",
    "@angular/http": "4.1.2",
    "@angular/platform-browser": "4.1.2",
    "@angular/platform-browser-dynamic": "4.1.2",
    "@ionic-native/core": "^3.10.2",
    "@ionic-native/file-chooser": "^4.1.0",
    "@ionic-native/geolocation": "^4.3.1",
    "@ionic-native/google-maps": "^4.3.1",
    "@ionic-native/keyboard": "^4.3.0",
    "@ionic-native/local-notifications": "^4.3.1",
    "@ionic-native/native-geocoder": "^4.1.0",
    "@ionic-native/native-storage": "^4.1.0",
    "@ionic-native/network": "^4.5.2",
    "@ionic-native/push": "^4.2.1",
    "@ionic-native/splash-screen": "3.10.2",
    "@ionic-native/status-bar": "3.10.2",
    "@ionic/storage": "^2.0.1",
    "@types/googlemaps": "^3.26.16",
    "@types/pouchdb": "^6.3.1",
    "angular-moment": "^1.1.0",
    "angular2-froala-wysiwyg": "^2.6.0",
    "angularfire2": "^5.0.0-rc.3",
    "cordova-android": "^6.2.3",
    "cordova-ios": "^4.4.0",
    "cordova-plugin-add-swift-support": "^1.7.0",
    "cordova-plugin-device": "^1.1.4",
    "cordova-plugin-filechooser": "^1.0.1",
    "cordova-plugin-nativegeocoder": "^2.0.1",
    "cordova-plugin-nativestorage": "^2.2.2",
    "cordova-plugin-splashscreen": "^4.0.3",
    "cordova-plugin-statusbar": "^2.2.2",
    "cordova-plugin-uniquedeviceid": "^1.3.2",
    "cordova-plugin-whitelist": "^1.3.1",
    "cordova-sqlite-storage": "^2.0.4",
    "de.appplant.cordova.plugin.local-notification": "~0.8.5",
    "firebase": "^4.6.0",
    "ionic-angular": "3.3.0",
    "ionic-native": "^2.9.0",
    "ionic-plugin-keyboard": "^2.2.1",
    "ionicons": "3.0.0",
    "js-marker-clusterer": "^1.0.0",
    "moment": "^2.18.1",
    "node-js-marker-clusterer": "^1.0.0",
    "phonegap-plugin-push": "^1.10.5",
    "pouchdb": "^6.3.4",
    "rxjs": "5.1.1",
    "sw-toolbox": "3.6.0",
    "time-ago-pipe": "^1.2.1",
    "zone.js": "0.8.11"
  },
  "devDependencies": {
    "@ionic/app-scripts": "1.3.7",
    "@ionic/cli-plugin-cordova": "1.6.1",
    "@ionic/cli-plugin-ionic-angular": "1.4.1",
    "@ionic/cli-plugin-proxy": "1.5.7",
    "ionic": "3.19.1",
    "typescript": "2.3.3"
  },
  "description": "An Ionic project",
  "cordova": {
    "plugins": {
      "cordova-plugin-device": {},
      "cordova-plugin-splashscreen": {},
      "cordova-plugin-statusbar": {},
      "cordova-plugin-whitelist": {},
      "ionic-plugin-keyboard": {},
      "cordova-plugin-nativestorage": {},
      "cordova-plugin-nativegeocoder": {},
      "cordova-sqlite-storage": {},
      "cordova-plugin-filechooser": {},
      "de.appplant.cordova.plugin.local-notification": {},
      "phonegap-plugin-push": {
        "SENDER_ID": "273044288663"
      },
      "cordova-plugin-googlemaps": {
        "API_KEY_FOR_ANDROID": "AIzaSyB-XKo27moS14yk4sDcFvwJ8vMQ-vAIbrA",
        "API_KEY_FOR_IOS": "AIzaSyBfBF5kKXyHYWDOb5mXxiIvLhKp2fheOLU"
      },
      "cordova-plugin-geolocation": {
        "GEOLOCATION_USAGE_DESCRIPTION": "To locate you"
      },
      "cordova-plugin-uniquedeviceid": {}
    },
    "platforms": [
      "android",
      "ios"
    ]
  },
  "config": {
    "ionic_copy": "./config/copy.config.js",
    "ionic_sass": "./config/sass.config.js"
  }
},
  "cordovaPlugins": [
    {
      "variables": {
        "SENDER_ID": "856296261796"
      },
      "locator": "phonegap-plugin-push"
    }
  ]
}

1 个答案:

答案 0 :(得分:1)

你需要在" cordovaPlugins"之前删除花括号。属性。

这是一个有效的json:

{
    "name": "devdactic-simpleLogin",
    "version": "0.0.1",
    "author": "Ionic Framework",
    "homepage": "http://ionicframework.com/",
    "private": true,
    "scripts": {
        "clean": "ionic-app-scripts clean",
        "build": "ionic-app-scripts build",
        "lint": "ionic-app-scripts lint",
        "ionic:build": "ionic-app-scripts build",
        "ionic:serve": "ionic-app-scripts serve"
    },
    "dependencies": {
        "@angular/common": "4.1.2",
        "@angular/compiler": "4.1.2",
        "@angular/compiler-cli": "4.1.2",
        "@angular/core": "4.1.2",
        "@angular/forms": "4.1.2",
        "@angular/http": "4.1.2",
        "@angular/platform-browser": "4.1.2",
        "@angular/platform-browser-dynamic": "4.1.2",
        "@ionic-native/core": "^3.10.2",
        "@ionic-native/file-chooser": "^4.1.0",
        "@ionic-native/geolocation": "^4.3.1",
        "@ionic-native/google-maps": "^4.3.1",
        "@ionic-native/keyboard": "^4.3.0",
        "@ionic-native/local-notifications": "^4.3.1",
        "@ionic-native/native-geocoder": "^4.1.0",
        "@ionic-native/native-storage": "^4.1.0",
        "@ionic-native/network": "^4.5.2",
        "@ionic-native/push": "^4.2.1",
        "@ionic-native/splash-screen": "3.10.2",
        "@ionic-native/status-bar": "3.10.2",
        "@ionic/storage": "^2.0.1",
        "@types/googlemaps": "^3.26.16",
        "@types/pouchdb": "^6.3.1",
        "angular-moment": "^1.1.0",
        "angular2-froala-wysiwyg": "^2.6.0",
        "angularfire2": "^5.0.0-rc.3",
        "cordova-android": "^6.2.3",
        "cordova-ios": "^4.4.0",
        "cordova-plugin-add-swift-support": "^1.7.0",
        "cordova-plugin-device": "^1.1.4",
        "cordova-plugin-filechooser": "^1.0.1",
        "cordova-plugin-nativegeocoder": "^2.0.1",
        "cordova-plugin-nativestorage": "^2.2.2",
        "cordova-plugin-splashscreen": "^4.0.3",
        "cordova-plugin-statusbar": "^2.2.2",
        "cordova-plugin-uniquedeviceid": "^1.3.2",
        "cordova-plugin-whitelist": "^1.3.1",
        "cordova-sqlite-storage": "^2.0.4",
        "de.appplant.cordova.plugin.local-notification": "~0.8.5",
        "firebase": "^4.6.0",
        "ionic-angular": "3.3.0",
        "ionic-native": "^2.9.0",
        "ionic-plugin-keyboard": "^2.2.1",
        "ionicons": "3.0.0",
        "js-marker-clusterer": "^1.0.0",
        "moment": "^2.18.1",
        "node-js-marker-clusterer": "^1.0.0",
        "phonegap-plugin-push": "^1.10.5",
        "pouchdb": "^6.3.4",
        "rxjs": "5.1.1",
        "sw-toolbox": "3.6.0",
        "time-ago-pipe": "^1.2.1",
        "zone.js": "0.8.11"
    },
    "devDependencies": {
        "@ionic/app-scripts": "1.3.7",
        "@ionic/cli-plugin-cordova": "1.6.1",
        "@ionic/cli-plugin-ionic-angular": "1.4.1",
        "@ionic/cli-plugin-proxy": "1.5.7",
        "ionic": "3.19.1",
        "typescript": "2.3.3"
    },
    "description": "An Ionic project",
    "cordova": {
        "plugins": {
            "cordova-plugin-device": {},
            "cordova-plugin-splashscreen": {},
            "cordova-plugin-statusbar": {},
            "cordova-plugin-whitelist": {},
            "ionic-plugin-keyboard": {},
            "cordova-plugin-nativestorage": {},
            "cordova-plugin-nativegeocoder": {},
            "cordova-sqlite-storage": {},
            "cordova-plugin-filechooser": {},
            "de.appplant.cordova.plugin.local-notification": {},
            "phonegap-plugin-push": {
                "SENDER_ID": "273044288663"
            },
            "cordova-plugin-googlemaps": {
                "API_KEY_FOR_ANDROID": "AIzaSyB-XKo27moS14yk4sDcFvwJ8vMQ-vAIbrA",
                "API_KEY_FOR_IOS": "AIzaSyBfBF5kKXyHYWDOb5mXxiIvLhKp2fheOLU"
            },
            "cordova-plugin-geolocation": {
                "GEOLOCATION_USAGE_DESCRIPTION": "To locate you"
            },
            "cordova-plugin-uniquedeviceid": {}
        },
        "platforms": [
            "android",
            "ios"
        ]
    },
    "config": {
        "ionic_copy": "./config/copy.config.js",
        "ionic_sass": "./config/sass.config.js"
    },
    "cordovaPlugins": [{
        "variables": {
            "SENDER_ID": "856296261796"
        },
        "locator": "phonegap-plugin-push"
    }]
}