ionic-team / ionic-cli

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

UnhandledPromiseRejectionWarning: SyntaxError: Unexpected token < in JSON at postion 83 #3076

Open Gert25 opened 6 years ago

Gert25 commented 6 years ago

Description: Unable to install cordova plugin.

Steps to Reproduce: running the following command in my terminal: ionic cordova plugin add cordova-plugin-google-analytics

Output:

> cordova plugin add cordova-plugin-google-analytics --save
(node:3095) UnhandledPromiseRejectionWarning: SyntaxError: Unexpected token < in JSON at position 83
    at JSON.parse (<anonymous>)
    at getJson (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/util/metadata.js:29:31)
    at Object.exports.save_fetch_metadata (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/util/metadata.js:56:24)
    at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/fetch.js:203:18
    at _fulfilled (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/q/q.js:787:54)
    at self.promiseDispatch.done (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/q/q.js:816:30)
    at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/q/q.js:749:13)
    at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/q/q.js:509:49
    at flush (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/q/q.js:108:17)
    at _combinedTickCallback (internal/process/next_tick.js:131:7)
(node:3095) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:3095) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.


My ionic info:

cli packages: (/usr/local/lib/node_modules)

    @ionic/cli-utils  : 1.19.2
    ionic (Ionic CLI) : 3.20.0

global packages:

    cordova (Cordova CLI) : 8.0.0

local packages:

    @ionic/app-scripts : 3.1.7-201801172029
    Cordova Platforms  : android 7.0.0 ios 4.5.4
    Ionic Framework    : ionic-angular 3.9.1-201711081842

System:

    Android SDK Tools : 26.1.1
    ios-deploy        : 1.9.2
    Node              : v8.11.1
    npm               : 5.6.0
    OS                : macOS High Sierra
    Xcode             : Xcode 9.2 Build version 9C40b

Environment Variables:

    ANDROID_HOME : /Users/gcvanrooyen25gmail.com/Library/Android/sdk

Misc:

    backend : pro

Other Information: package Json

{
  "name": "sidemenu_ionic",
  "version": "0.0.1",
  "author": "Ionic Framework",
  "homepage": "http://ionicframework.com/",
  "private": true,
  "config": {
    "ionic_webpack": "./webpack.config.js"
  },
  "scripts": {
    "clean": "ionic-app-scripts clean",
    "start": "concurrently \"ionic-app-scripts serve --dev\" \"NODE_ENV=dev nodemon server.js\"  ",
    "builduat": "concurrently \"ionic-app-scripts build --dev\" \"NODE_ENV=dev nodemon server.js\"  ",
    "build": "ionic-app-scripts build --prod",
    "lint": "ionic-app-scripts lint",
    "ionic:build": "ionic-app-scripts build --prod",
    "ionic:serve": "ionic-app-scripts serve",
    "prod": "concurrently \"ionic-app-scripts serve --prod\" \"NODE_ENV=prod node initialize_admin.js\" ",
    "server": " NODE_ENV='dev' nodemon  ./server.js "
  },
  "dependencies": {
    "@angular/common": "^5.2.1",
    "@angular/compiler": "5.2.1",
    "@angular/compiler-cli": "5.2.1",
    "@angular/core": "5.2.1",
    "@angular/forms": "5.2.1",
    "@angular/http": "5.2.1",
    "@angular/platform-browser": "5.2.1",
    "@angular/platform-browser-dynamic": "5.2.1",
    "@ionic-native/core": "4.4.0",
    "@ionic-native/google-analytics": "^4.7.0",
    "@ionic-native/splash-screen": "4.4.0",
    "@ionic-native/status-bar": "4.4.0",
    "@ionic/pro": "1.0.16",
    "@ionic/storage": "2.1.3",
    "aws-sdk": "^2.200.0",
    "body-parser": "^1.18.2",
    "concurrently": "^3.5.1",
    "cordova-plugin-google-analytics": "^1.8.3",
    "defaultable": "^0.7.2",
    "dns": "^0.2.2",
    "express": "^4.16.2",
    "firebase": "^4.8.0",
    "firebase-admin": "^5.11.0",
    "firebase-functions": "^0.9.1",
    "heroku-ssl-redirect": "0.0.4",
    "ionic-angular": "nightly",
    "ionicons": "3.0.0",
    "nodemailer": "^4.4.2",
    "nodemailer-ses-transport": "^1.5.1",
    "process": "^0.11.10",
    "pug": "^2.0.1",
    "rxjs": "5.5.2",
    "sendpulse-api": "^1.0.3",
    "shortid": "^2.2.8",
    "sw-toolbox": "3.6.0",
    "swig": "^1.4.2",
    "swig-email-templates": "^5.0.1",
    "zone.js": "0.8.18"
  },
  "devDependencies": {
    "@ionic/app-scripts": "nightly",
    "chokidar": "^2.0.3",
    "nodemon": "^1.14.11",
    "rollup-plugin-replace": "^2.0.0",
    "typescript": "2.4.2"
  },
  "description": "An Ionic project",
  "cordova": {
    "plugins": {
      "cordova-plugin-google-analytics": {}
    }
  }
}
Gert25 commented 6 years ago

Also what is weird about this issue. When I run this in a different Ionic application I maintain it installs with no error.

john-peter-schmmitt commented 6 years ago

I have tried solving this issue by also running a clean build. ionic-app-scripts clean

Gert25 commented 6 years ago

I have also tried recloning the instance and doing a clean install. it doesn't seem to work either.

Gert25 commented 6 years ago

Running ionic doctor check I get the following

image

not sure what it really wants me to do

imhoffd commented 6 years ago

@Gert25 platforms/ and plugins/ should (usually) not be committed to version control. I often recommend to people when they have strange Cordova issues like this to do the following, if appropriate for their project:

rm -rf platforms/ plugins/
ionic cordova prepare

This forces Cordova to re-generate the native projects.

Gert25 commented 6 years ago

Hi JP

sorry for this, my browser seemed to save your email credentials. So the people from Github seems to reply to your email instead of mine. I will remove this immediately.

Regards

On Mon, Apr 23, 2018 at 6:11 PM, dwieeb notifications@github.com wrote:

@Gert25 https://github.com/Gert25 platforms/ and plugins/ should (usually) not be committed to version control. I often recommend to people when they have strange Cordova issues like this to do the following, if appropriate for their project:

rm -rf platforms/ plugins/ ionic cordova prepare

This forces Cordova to re-generate the native projects.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ionic-team/ionic-cli/issues/3076#issuecomment-383632207, or mute the thread https://github.com/notifications/unsubscribe-auth/APbeNdpEpAiEyCL-xMtk3TBW5v8R1bAlks5trf1AgaJpZM4TN1Hz .

john-peter-schmmitt commented 6 years ago

HI Gert

Not a problem, did you has this been relevant to the database I referred to on firebase or is it your personal projects?

Kind regards,

From: Gert van Rooyen notifications@github.com Sent: Monday, 23 April 2018 7:12 PM To: ionic-team/ionic-cli ionic-cli@noreply.github.com Cc: john-peter-schmmitt john-peter@synrec.net; Manual manual@noreply.github.com Subject: Re: [ionic-team/ionic-cli] UnhandledPromiseRejectionWarning: SyntaxError: Unexpected token < in JSON at postion 83 (#3076)

Hi JP

sorry for this, my browser seemed to save your email credentials. So the people from Github seems to reply to your email instead of mine. I will remove this immediately.

Regards

On Mon, Apr 23, 2018 at 6:11 PM, dwieeb <notifications@github.com mailto:notifications@github.com > wrote:

@Gert25 https://github.com/Gert25 platforms/ and plugins/ should (usually) not be committed to version control. I often recommend to people when they have strange Cordova issues like this to do the following, if appropriate for their project:

rm -rf platforms/ plugins/ ionic cordova prepare

This forces Cordova to re-generate the native projects.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ionic-team/ionic-cli/issues/3076#issuecomment-383632207, or mute the thread https://github.com/notifications/unsubscribe-auth/APbeNdpEpAiEyCL-xMtk3TBW5v8R1bAlks5trf1AgaJpZM4TN1Hz .

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ionic-team/ionic-cli/issues/3076#issuecomment-383651476 , or mute the thread https://github.com/notifications/unsubscribe-auth/Akb_lVfCkXNmX2T7UvEWRL2WXAr1T_knks5trgt7gaJpZM4TN1Hz . https://github.com/notifications/beacon/Akb_lX7QxjYOEgEBBs5pSF1oYrojPasZks5trgt7gaJpZM4TN1Hz.gif

john-peter-schmmitt commented 6 years ago

HI

Its under settings https://console.firebase.google.com/u/0/project/scoobydoo-e0eb8/settings/general/android:com.scoobydooit.ScoobyDoo

And im going to try check now because any required code I think might be derived from https://developer.here.com/develop/mobile-sdks I’m taking a guess thou, when I merger my old gsuit wo the new one i got some welcome and junk mail registered to the old Gsuit. I’m hoping I can find all the lose ends

From: Gert van Rooyen notifications@github.com Sent: Monday, 23 April 2018 7:12 PM To: ionic-team/ionic-cli ionic-cli@noreply.github.com Cc: john-peter-schmmitt john-peter@synrec.net; Manual manual@noreply.github.com Subject: Re: [ionic-team/ionic-cli] UnhandledPromiseRejectionWarning: SyntaxError: Unexpected token < in JSON at postion 83 (#3076)

Hi JP

sorry for this, my browser seemed to save your email credentials. So the people from Github seems to reply to your email instead of mine. I will remove this immediately.

Regards

On Mon, Apr 23, 2018 at 6:11 PM, dwieeb notifications@github.com wrote:

@Gert25 https://github.com/Gert25 platforms/ and plugins/ should (usually) not be committed to version control. I often recommend to people when they have strange Cordova issues like this to do the following, if appropriate for their project:

rm -rf platforms/ plugins/ ionic cordova prepare

This forces Cordova to re-generate the native projects.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ionic-team/ionic-cli/issues/3076#issuecomment-383632207, or mute the thread https://github.com/notifications/unsubscribe-auth/APbeNdpEpAiEyCL-xMtk3TBW5v8R1bAlks5trf1AgaJpZM4TN1Hz .

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ionic-team/ionic-cli/issues/3076#issuecomment-383651476 , or mute the thread https://github.com/notifications/unsubscribe-auth/Akb_lVfCkXNmX2T7UvEWRL2WXAr1T_knks5trgt7gaJpZM4TN1Hz .

john-peter-schmmitt commented 6 years ago

That is basically the file

From: Gert van Rooyen notifications@github.com Sent: Monday, 23 April 2018 7:12 PM To: ionic-team/ionic-cli ionic-cli@noreply.github.com Cc: john-peter-schmmitt john-peter@synrec.net; Manual manual@noreply.github.com Subject: Re: [ionic-team/ionic-cli] UnhandledPromiseRejectionWarning: SyntaxError: Unexpected token < in JSON at postion 83 (#3076)

Hi JP

sorry for this, my browser seemed to save your email credentials. So the people from Github seems to reply to your email instead of mine. I will remove this immediately.

Regards

On Mon, Apr 23, 2018 at 6:11 PM, dwieeb <notifications@github.com mailto:notifications@github.com > wrote:

@Gert25 https://github.com/Gert25 platforms/ and plugins/ should (usually) not be committed to version control. I often recommend to people when they have strange Cordova issues like this to do the following, if appropriate for their project:

rm -rf platforms/ plugins/ ionic cordova prepare

This forces Cordova to re-generate the native projects.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ionic-team/ionic-cli/issues/3076#issuecomment-383632207, or mute the thread https://github.com/notifications/unsubscribe-auth/APbeNdpEpAiEyCL-xMtk3TBW5v8R1bAlks5trf1AgaJpZM4TN1Hz .

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ionic-team/ionic-cli/issues/3076#issuecomment-383651476 , or mute the thread https://github.com/notifications/unsubscribe-auth/Akb_lVfCkXNmX2T7UvEWRL2WXAr1T_knks5trgt7gaJpZM4TN1Hz . https://github.com/notifications/beacon/Akb_lX7QxjYOEgEBBs5pSF1oYrojPasZks5trgt7gaJpZM4TN1Hz.gif

john-peter-schmmitt commented 6 years ago

Hi Gert

So everything seems to be lying in firebase https://console.firebase.google.com/u/0/project/scoobydoo-e0eb8/settings/serviceaccounts/databasesecrets you get the key and if you go to manage all service accounts it directs your to https://console.cloud.google.com/iam-admin/serviceaccounts/project?consoleUI=FIREBASE https://console.cloud.google.com/iam-admin/serviceaccounts/project?consoleUI=FIREBASE&project=scoobydoo-e0eb8&authuser=0&pli=1 &project=scoobydoo-e0eb8&authuser=0&pli=1

From: Gert van Rooyen notifications@github.com Sent: Monday, 23 April 2018 7:12 PM To: ionic-team/ionic-cli ionic-cli@noreply.github.com Cc: john-peter-schmmitt john-peter@synrec.net; Manual manual@noreply.github.com Subject: Re: [ionic-team/ionic-cli] UnhandledPromiseRejectionWarning: SyntaxError: Unexpected token < in JSON at postion 83 (#3076)

Hi JP

sorry for this, my browser seemed to save your email credentials. So the people from Github seems to reply to your email instead of mine. I will remove this immediately.

Regards

On Mon, Apr 23, 2018 at 6:11 PM, dwieeb notifications@github.com wrote:

@Gert25 https://github.com/Gert25 platforms/ and plugins/ should (usually) not be committed to version control. I often recommend to people when they have strange Cordova issues like this to do the following, if appropriate for their project:

rm -rf platforms/ plugins/ ionic cordova prepare

This forces Cordova to re-generate the native projects.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ionic-team/ionic-cli/issues/3076#issuecomment-383632207, or mute the thread https://github.com/notifications/unsubscribe-auth/APbeNdpEpAiEyCL-xMtk3TBW5v8R1bAlks5trf1AgaJpZM4TN1Hz .

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ionic-team/ionic-cli/issues/3076#issuecomment-383651476 , or mute the thread https://github.com/notifications/unsubscribe-auth/Akb_lVfCkXNmX2T7UvEWRL2WXAr1T_knks5trgt7gaJpZM4TN1Hz .

Gert25 commented 6 years ago

Hi cool

I will check this out as soon as I can free up sometime.

Regards

On Tue, Apr 24, 2018 at 6:04 PM, john-peter-schmmitt < notifications@github.com> wrote:

Hi Gert

So everything seems to be lying in firebase https://console.firebase. google.com/u/0/project/scoobydoo-e0eb8/settings/serviceaccounts/ databasesecrets you get the key and if you go to manage all service accounts it directs your to https://console.cloud.google. com/iam-admin/serviceaccounts/project?consoleUI=FIREBASE < https://console.cloud.google.com/iam-admin/serviceaccounts/ project?consoleUI=FIREBASE&project=scoobydoo-e0eb8&authuser=0&pli=1> &project=scoobydoo-e0eb8&authuser=0&pli=1

From: Gert van Rooyen notifications@github.com Sent: Monday, 23 April 2018 7:12 PM To: ionic-team/ionic-cli ionic-cli@noreply.github.com Cc: john-peter-schmmitt john-peter@synrec.net; Manual < manual@noreply.github.com> Subject: Re: [ionic-team/ionic-cli] UnhandledPromiseRejectionWarning: SyntaxError: Unexpected token < in JSON at postion 83 (#3076)

Hi JP

sorry for this, my browser seemed to save your email credentials. So the people from Github seems to reply to your email instead of mine. I will remove this immediately.

Regards

On Mon, Apr 23, 2018 at 6:11 PM, dwieeb notifications@github.com wrote:

@Gert25 https://github.com/Gert25 platforms/ and plugins/ should (usually) not be committed to version control. I often recommend to people when they have strange Cordova issues like this to do the following, if appropriate for their project:

rm -rf platforms/ plugins/ ionic cordova prepare

This forces Cordova to re-generate the native projects.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ionic-team/ionic-cli/issues/3076# issuecomment-383632207, or mute the thread https://github.com/notifications/unsubscribe-auth/APbeNdpEpAiEyCL- xMtk3TBW5v8R1bAlks5trf1AgaJpZM4TN1Hz .

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ionic- team/ionic-cli/issues/3076#issuecomment-383651476 , or mute the thread < https://github.com/notifications/unsubscribe-auth/Akb_ lVfCkXNmX2T7UvEWRL2WXAr1T_knks5trgt7gaJpZM4TN1Hz> .

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ionic-team/ionic-cli/issues/3076#issuecomment-383988130, or mute the thread https://github.com/notifications/unsubscribe-auth/APbeNZqh2mBx_1UidQ0uTYtk2-8ak1Ztks5tr00DgaJpZM4TN1Hz .