Ionic Serve SyntaxError: Unexpected end of JSON input


#1

Hi Guys

I keep running into an error when I try to run ionic serve , I tried removing ionic + cordova , uninstalled node and reinstalled v6.11 still no luck. See error info below


c:\MobileApps Repository\FinalApps\MANGOO>ionic serve -l --verbose
[DEBUG] Loading global plugin @ionic/cli-plugin-proxy
[DEBUG] Throwing PLUGIN_NOT_INSTALLED for global @ionic/cli-plugin-proxy
[DEBUG] Loading local plugin @ionic/cli-plugin-cordova
[DEBUG] Loading local plugin @ionic/cli-plugin-ionic-angular
[DEBUG] Getting plugin info for ionic
[DEBUG] Getting plugin info for @ionic/cli-plugin-cordova
[DEBUG] Getting plugin info for @ionic/cli-plugin-ionic-angular
[DEBUG] Checking for latest plugin version of ionic@latest.
[DEBUG] Checking for latest plugin version of @ionic/cli-plugin-cordova@latest.
[DEBUG] Checking for latest plugin version of @ionic/cli-plugin-ionic-angular@latest.
[DEBUG] !!! ERROR ENCOUNTERED !!!
SyntaxError: Unexpected end of JSON input
[DEBUG] SyntaxError: Unexpected end of JSON input
        at JSON.parse (<anonymous>)
        at
        C:\Users\KingKunta\AppData\Roaming\npm\node_modules\ionic\node_modules\@ionic\cli-utils\dist\lib\plugins.js:375:38
        at Generator.next (<anonymous>)
        at fulfilled
        (C:\Users\KingKunta\AppData\Roaming\npm\node_modules\ionic\node_modules\@ionic\cli-utils\dist\lib\plugins.js:4:58)
        at <anonymous>

Here is my info:

c:\MobileApps Repository\FinalApps\MANGOO>ionic info --verbose
[DEBUG] Loading global plugin @ionic/cli-plugin-proxy
[DEBUG] Throwing PLUGIN_NOT_INSTALLED for global @ionic/cli-plugin-proxy
[DEBUG] Loading local plugin @ionic/cli-plugin-cordova
[DEBUG] Loading local plugin @ionic/cli-plugin-ionic-angular

global packages:

    @ionic/cli-utils : 1.4.0
    Cordova CLI      : 7.0.1
    Ionic CLI        : 3.4.0

local packages:

    @ionic/app-scripts              : 1.3.7
    @ionic/cli-plugin-cordova       : 1.4.0
    @ionic/cli-plugin-ionic-angular : 1.3.1
    Cordova Platforms               : android 6.2.3
    Ionic Framework                 : ionic-angular 3.3.0

System:

    Node       : v8.1.0
    OS         : Windows 7
    Xcode      : not installed
    ios-deploy : not installed
    ios-sim    : not installed
    npm        : 1.4.9

Regards
Bongani


#2

npm 1.4.9? This doesn’t sound right. You should install a current LTS nodejs verison that includes a 3.x npm version.


#3

Thanks for pointing that out, I used choco to do the installation last year and I forgot about it . I managed to upgrade npm to the latest and reinstalled all the other packages. Its sorted now.