Ionic serve fail after upgrade to ionic cli v3


#1

i upgrade the ionic cli to v3 as this blog said http://blog.ionic.io/announcing-ionic-cli-v3/,

but when i run ionic serve in my project, it blocked and stop running.

Below is my output when i run ionic sever --verbose:

> [ERROR] Error occurred while loading plugins. CLI functionality may be limited.
>         Checking for CLI updates now...
> [DEBUG] Plugin error: FILE_INVALID_JSON
> [DEBUG] Checking for latest plugin version of ionic@latest.
> "3.0.0"

> [DEBUG] Latest version of ionic@latest is .
> [DEBUG] !!! ERROR ENCOUNTERED !!!
> SyntaxError: Unexpected end of JSON input
> [DEBUG] SyntaxError: Unexpected end of JSON input
>             at Object.parse (native)
>             at /Users/boutell/npm/lib/node_modules/ionic/node_modules/@ionic/cli-utils/dist/lib/plugins.js:212:36
>             at next (native)
>             at fulfilled (/Users/boutell/npm/lib/node_modules/ionic/node_modules/@ionic/cli-utils/dist/lib/plugins.js:4:58)

And my `ionic info` is:
> [ERROR] Error occurred while loading plugins. CLI functionality may be limited.
>         Checking for CLI updates now...
> [ERROR] No updates found after plugin error--please report this issue.

> global packages:

>     @ionic/cli-utils : 1.0.0
>     Ionic CLI        : 3.0.0

> System:

>     Node       : v6.10.1
>     OS         : macOS Sierra
>     Xcode      : Xcode 8.3 Build version 8E162
>     ios-deploy : 1.8.1
>     ios-sim    : 5.0.6

What't wrong with my project?

#2

Please show me your ionic info.


#3

[ERROR] Error occurred while loading plugins. CLI functionality may be limited.
Checking for CLI updates now…
[ERROR] No updates found after plugin error–please report this issue.

global packages:

@ionic/cli-utils : 1.0.0
Ionic CLI        : 3.0.0

System:

Node       : v6.10.1
OS         : macOS Sierra
Xcode      : Xcode 8.3 Build version 8E162
ios-deploy : 1.8.1
ios-sim    : 5.0.6

#4

I don’t see the local packages in your ionic info:

local packages:

@ionic/app-scripts              : 1.3.7
@ionic/cli-plugin-cordova       : 1.0.0
@ionic/cli-plugin-ionic-angular : 1.0.0
Ionic Framework                 : ionic-angular 3.2.0

#5

i have tried run

npm uninstall -g ionic
npm install -g ionic@latest

and

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

but it still not work.


#6

My package.json file is below:

{
  "name": "ionic-hello-world",
  "author": "Ionic Framework",
  "homepage": "http://ionicframework.com/",
  "private": true,
  "scripts": {
    "build": "ionic-app-scripts build",
    "watch": "ionic-app-scripts watch",
    "serve:before": "watch",
    "emulate:before": "build",
    "deploy:before": "build",
    "build:before": "build",
    "run:before": "build"
  },
  "dependencies": {
    "@angular/common": "4.0.0",
    "@angular/compiler": "4.0.0",
    "@angular/compiler-cli": "4.0.0",
    "@angular/core": "4.0.0",
    "@angular/forms": "4.0.0",
    "@angular/http": "4.0.0",
    "@angular/platform-browser": "4.0.0",
    "@angular/platform-browser-dynamic": "4.0.0",
    "@ionic-native/core": "^3.4.2",
    "@ionic-native/splash-screen": "3.4.2",
    "@ionic-native/status-bar": "3.4.2",
    "@ionic/storage": "2.0.1",
    "ionic-angular": "3.0.1",
    "ionic-native": "^2.9.0",
    "ionicons": "3.0.0",
    "rxjs": "5.1.1",
    "sw-toolbox": "3.4.0",
    "zone.js": "^0.8.4"
  },
  "devDependencies": {
    "@ionic/app-scripts": "1.3.7",
    "@ionic/cli-plugin-cordova": "1.0.0",
    "@ionic/cli-plugin-ionic-angular": "1.0.0",
    "typescript": "~2.2.1"
  },
  "description": "sharemap: An Ionic project",
  "cordovaPlugins": [
    "cordova-plugin-device",
    "cordova-plugin-console",
    "cordova-plugin-whitelist",
    "cordova-plugin-splashscreen",
    "cordova-plugin-statusbar",
    "ionic-plugin-keyboard"
  ],
  "cordovaPlatforms": []
}

#7

have you tried updating npm. npm update


#8

I am having exactly the same issue. Please let me know if you found a resolution.


#9

Please also show us your ionic info output and package.json.


#10

I created an issue for this problem by the way:


#11

Given the line number in the OP, this is failing parsing the result of:

npm view [name-of-some-plugin] --json

What the plugin name is might be interesting, but fundamentally this looks like a network error to me.


#12

The below advise was able to resolve my issue.


#13

5 posts were split to a new topic: Localhost:8100 not accessible after upgrade to Ionic CLI v3