Ionic serve not working after upgrade to CLI 3.7

I’ve just upgraded to Ionic CLI 3.7.0 and my ionic serve command no longer works!!

This is what I get when I run it and nothing more, it just exits the execution. Any ideas what is wrong here? Many thanks!

[INFO] Starting app-scripts server: --port 8100 --p 8100 --livereload-port 35729 --r 35729 --address localhost - Ctrl+C
       to cancel
[13:06:03]  watch started ... 
[13:06:03]  build dev started ...
2 Likes

What is your ionic info output?
Can you run ionic serve --verbose?
What about npm run ionic:build --verbose?

1 Like

cli packages:

@ionic/cli-plugin-cordova       : 1.6.1
@ionic/cli-plugin-ionic-angular : 1.4.1
@ionic/cli-utils                : 1.7.0
ionic (Ionic CLI)               : 3.7.0

global packages:

Cordova CLI : 7.0.1 

local packages:

@ionic/app-scripts : 2.1.3
Cordova Platforms  : ios 4.4.0
Ionic Framework    : ionic-angular 3.6.0

System:

Node       : v7.10.0
OS         : macOS Sierra
Xcode      : Xcode 8.3.3 Build version 8E3004b 
ios-deploy : 1.9.0 
ios-sim    : 5.0.12 
npm        : 4.2.0

ionic serve --verbose =>didn’t work, there were errors;

npm run ionic:build --verbose =>ran, finnished with OK.

What errors? That is kind of relevant…

Please also post the output of ionic:build for comparison.

1 Like

ionic serve --verbose:

[DEBUG] CLI flags: { interactive: true, confirm: false }
[DEBUG] { cwd: '/Users/Documents/Development/app', local: true, binPath:
        '/usr/local/lib/node_modules/ionic/bin/ionic', libPath:
        '/Users/Documents/Development/app/node_modules/ionic/dist/index.js' }
[DEBUG] Loading local plugin @ionic/cli-plugin-proxy
[DEBUG] Throwing PLUGIN_NOT_INSTALLED for local @ionic/cli-plugin-proxy
[DEBUG] Loading local plugin @ionic/cli-plugin-cordova
[DEBUG] Loading local plugin @ionic/cli-plugin-ionic-angular
[DEBUG] New daemon pid: 70972
[DEBUG] Getting plugin info for ionic
[DEBUG] Checking for latest plugin version of ionic@latest.
[DEBUG] Getting plugin info for @ionic/cli-plugin-cordova
[DEBUG] Checking for latest plugin version of @ionic/cli-plugin-cordova@latest.
[DEBUG] Getting plugin info for @ionic/cli-plugin-ionic-angular
[DEBUG] Checking for latest plugin version of @ionic/cli-plugin-ionic-angular@latest.
[INFO] Starting app-scripts server: --log-level debug --port 8100 --p 8100 --livereload-port 35729 --r 35729 --address
       localhost - Ctrl+C to cancel
[13:36:38]  watch started ... 
[13:36:38]  build dev started ...

npm run ionic:build --verbose:

npm info it worked if it ends with ok
npm verb cli [ '/usr/local/bin/node',
npm verb cli   '/usr/local/bin/npm',
npm verb cli   'run',
npm verb cli   'ionic:build',
npm verb cli   '--verbose' ]
npm info using npm@4.2.0
npm info using node@v7.10.0
npm verb run-script [ 'preionic:build', 'ionic:build', 'postionic:build' ]
npm info lifecycle ionic-hello-world@~preionic:build: ionic-hello-world@
npm info lifecycle ionic-hello-world@~ionic:build: ionic-hello-world@

[13:38:16]  lint finished in 3.14 s 
npm verb lifecycle ionic-hello-world@~ionic:build: unsafe-perm in lifecycle true
npm verb lifecycle ionic-hello-world@~ionic:build: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/Users/Documents/Development/app/node_modules/.bin:/Users/google-cloud-sdk/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Applications/adt-bundle-mac-x86_64-20140321/sdk/tools:/Applications/adt-bundle-mac-x86_64-20140321/sdk/platform-tools
npm verb lifecycle ionic-hello-world@~ionic:build: CWD: /Users/Documents/Development/app
npm info lifecycle ionic-hello-world@~postionic:build: ionic-hello-world@
npm verb exit [ 0, true ]
npm info ok
1 Like

There are no errors, just DEBUG output that is asolutely normal.
Does it just return to the command line after the last line?

That is less than expected and quite strange.

Yes, it just returns to the command line.

With npm run ionic:build --verbose: the output is huge (like 30+ pages, so I’ve only copied here the start and end, in between there are only recommendations of what files are not used but are in the code.

It’s very strange that all ionic serve command just jump back to the command line.

The strange thing is that it does so during the “build” part…

npm run ionic:serve --verbose please.

1 Like

wow! npm run ionic:serve --verbose launched it!!!

2 Likes

This is probably because it doesn’t try to do a build before launching… so your problem is actually the build step of the serve.

Dimitris-app my$ npm run ionic:serve --verbose
npm info it worked if it ends with ok
npm verb cli [ '/usr/local/bin/node',
npm verb cli   '/usr/local/bin/npm',
npm verb cli   'run',
npm verb cli   'ionic:serve',
npm verb cli   '--verbose' ]
npm info using npm@4.2.0
npm info using node@v7.10.0
npm verb run-script [ 'preionic:serve', 'ionic:serve', 'postionic:serve' ]
npm info lifecycle ionic-hello-world@~preionic:serve: ionic-hello-world@
npm info lifecycle ionic-hello-world@~ionic:serve: ionic-hello-world@

> ionic-hello-world@ ionic:serve /Users/Documents/Development/app
> ionic-app-scripts serve

[13:56:57]  ionic-app-scripts 2.1.3 
[13:56:57]  watch started ... 
[13:56:57]  build dev started ... 
[13:56:57]  clean started ... 
[13:56:57]  clean finished in 2 ms 
[13:56:57]  copy started ... 
[13:56:57]  transpile started ... 
[13:57:01]  transpile finished in 4.07 s 
[13:57:01]  preprocess started ... 
[13:57:01]  deeplinks started ... 
[13:57:01]  deeplinks finished in 87 ms 
[13:57:01]  preprocess finished in 88 ms 
[13:57:01]  webpack started ... 
[13:57:01]  copy finished in 4.32 s 
[13:57:11]  webpack finished in 10.70 s 
[13:57:11]  sass started ... 
[13:57:13]  sass finished in 1.44 s 
[13:57:13]  postprocess started ... 
[13:57:13]  postprocess finished in 4 ms 
[13:57:13]  lint started ... 
[13:57:13]  build dev finished in 16.35 s 
[13:57:13]  watch ready in 16.41 s 
[13:57:13]  dev server running: http://localhost:8101/ 

[13:57:17]  tslint: src/providers/phone-storage.ts, line: 3 
            All imports are unused. 

       L2:  // import { Storage } from '@ionic/storage';
       L3:  import firebase from 'firebase';
       L4:  import { FirebaseDatabase } from './firebase-database';

[13:57:17]  tslint: src/providers/push-notifications.ts, line: 2 
            All imports are unused. 

       L1:  import { Injectable } from '@angular/core';
       L2:  import { Http } from '@angular/http';
       L3:  import 'rxjs/add/operator/map';

[13:57:17]  tslint: src/pages/login/login.ts, line: 3 
            'FacebookLoginResponse' is declared but never used. 

       L2:  import { NavController, NavParams, App, LoadingController } from 'ionic-angular';
       L3:  import { Facebook, FacebookLoginResponse } from '@ionic-native/facebook';
       L4:  import firebase from 'firebase';

[13:57:17]  tslint: src/pages/profile/profile.ts, line: 5 
            All imports are unused. 

       L4:  import { LoginPage } from '../login/login';
       L5:  import firebase from 'firebase';
       L6:  import { Auth } from '../../providers/auth';

[13:57:17]  tslint: src/providers/geocoding.ts, line: 16 
            Property 'geolocation' is declared but never used. 

      L16:    constructor(private geolocation: Geolocation, private googleMaps: GoogleMaps, public platform: Platform) {

[13:57:17]  tslint: src/providers/geocoding.ts, line: 16 
            Property 'googleMaps' is declared but never used. 

      L16:    constructor(private geolocation: Geolocation, private googleMaps: GoogleMaps, public platform: Platform) {

[13:57:17]  tslint: src/providers/geocoding.ts, line: 2 
            'CameraPosition' is declared but never used. 

       L1:  import { Injectable } from '@angular/core';
       L2:  import { GoogleMaps, GoogleMap, GoogleMapsEvent, LatLng, CameraPosition, MarkerOptions, Marker } from '@ioni
       L3:  import { Geolocation } from '@ionic-native/geolocation';

[13:57:17]  tslint: src/providers/geocoding.ts, line: 2 
            'MarkerOptions' is declared but never used. 

       L1:  import { Injectable } from '@angular/core';
       L2:  gleMaps, GoogleMap, GoogleMapsEvent, LatLng, CameraPosition, MarkerOptions, Marker } from '@ionic-native/goo
       L3:  import { Geolocation } from '@ionic-native/geolocation';

[13:57:17]  tslint: src/providers/geocoding.ts, line: 2 
            'Marker' is declared but never used. 

       L1:  import { Injectable } from '@angular/core';
       L2:  oogleMap, GoogleMapsEvent, LatLng, CameraPosition, MarkerOptions, Marker } from '@ionic-native/google-maps';
       L3:  import { Geolocation } from '@ionic-native/geolocation';

[13:57:17]  tslint: src/providers/firebase-storage.ts, line: 5 
            'Modal' is declared but never used. 

       L4:  import { File } from '@ionic-native/file';
       L5:  import { Modal, NavController, Platform } from 'ionic-angular';
       L6:  import { Observable } from 'rxjs/Rx';

[13:57:17]  tslint: src/providers/firebase-storage.ts, line: 5 
            'NavController' is declared but never used. 

       L4:  import { File } from '@ionic-native/file';
       L5:  import { Modal, NavController, Platform } from 'ionic-angular';
       L6:  import { Observable } from 'rxjs/Rx';


       L5:  import { File } from '@ionic-native/file';
       L6:  import { Camera, CameraOptions } from '@ionic-native/camera';

[13:57:17]  lint finished in 4.51 s 
^C

Huh, that does build.

Well, then I am officially out of ideas. Might be a problem with 3.7 though - it is brand new after all. And there was some work done adding ionic build that could touch these areas.

Yes, true! I’ll play around with it a bit more still, will post here if I find a solution!

Many thanks!

Hello all
I have the same problem
when i downgrade to 3.6 i get

-- ionic@3.6.0 invalid +-- @ionic/cli-utils@1.6.0 | +-- archiver@1.3.0 | |– readable-stream@2.3.3
| | ±- isarray@1.0.0
| | -- string_decoder@1.0.3 | +-- cross-spawn@4.0.2 | +-- string-width@2.1.1 | |– is-fullwidth-code-point@2.0.0
| -- strip-ansi@4.0.0 |– ansi-regex@3.0.0
`-- opn@4.0.2

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.2: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“win32”,“arch”:“x64”})
npm WARN ajv-keywords@2.1.0 requires a peer of ajv@>=5.0.0 but none was installed

any Solutions

1 Like

i tried several times downgrading and its OK now
i am on 3.6 now not 3.7

2 Likes

Seems you are not alone, this looks quite similar: https://github.com/ionic-team/ionic-cli/issues/2602

1 Like

Same issue. Cant serve my project

1 Like

I’ve updated to last Node LTS and now I can run ionic serve:

Android SDK Tools : 25.2.2
Node : v6.11.2
OS : macOS Sierra
Xcode : Xcode 8.3.3 Build version 8E3004b
ios-deploy : 1.9.0
npm : 3.10.10

That’s not the latest Node version, I’ve got v7.10.0 and it doesn’t serve.