(Solved) "ionic serve" hanging

I don’t know how it happened, but “ionic serve” stopped working for me suddenly. It keeps hanging on:

[telmo@Telmo-PC ionicApp]$ ionic serve
******************************************************
 Dependency warning - for the CLI to run correctly,      
 it is highly recommended to install/upgrade the following:     

 Please install your Cordova CLI to version  >=4.2.0 `npm install -g cordova`

******************************************************

> ionic-hello-world@ ionic:serve /home/telmo/Documents/ionicApp
> ionic-app-scripts serve "--v2" "--address" "0.0.0.0" "--port" "8100" "--livereload-port" "35729"

I’ve waited quite a few minutes and still nothing, already tried rebooting, reinstalling ionic with “sudo npm install -g cordova ionic”, running the command on new projects, no success.

My “ionic info” is as follows:

[telmo@Telmo-PC ~]$ ionic info
******************************************************
 Dependency warning - for the CLI to run correctly,      
 it is highly recommended to install/upgrade the following:     

 Please install your Cordova CLI to version  >=4.2.0 `npm install -g cordova`

******************************************************

Your system information:

Cordova CLI:  You have been opted out of telemetry. To change this, run: cordova telemetry on.
6.5.0

Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Linux 4.10
Node Version: v7.7.3
Xcode version: Not installed


******************************************************
 Dependency warning - for the CLI to run correctly,      
 it is highly recommended to install/upgrade the following:     

 Please install your Cordova CLI to version  >=4.2.0 `npm install -g cordova`

******************************************************

Does anyone have any suggestion? Thanks in advance.

Edit: I also noticed this only happens with Ionic 2 projects (with --v2), Ionic 1 projects work just fine.

FYI I noticed this happens when using ionic app scripts 1.1.4.

if I downgrade ionic app scripts to 1.0.0 ionic serve works fine but I think that may have caused me an issue deploying to the device but I can’t remember properly sorry.

I just noticed I get an error when running “npm list”:

├── UNMET PEER DEPENDENCY typescript@2.0.9
└── zone.js@0.7.2

npm ERR! peer dep missing: typescript@~2.2.1, required by @ionic/app-scripts@1.2.2

The problem is nor ‘npm install typescript@2.2.1’ or ‘npm update typescript’ seem to solve the issue.

Same problem.

Cleaned everything, then installed:

sudo npm install -g cordova ionic

Then run:

ionic start myapp --v2

and

ionic serve

ionic-hello-world@ ionic:serve /home/sasha/Project/myapp
ionic-app-scripts serve “–v2” “–address” “0.0.0.0” “–port” “8100” “–livereload-port” “35729”
and nothing

ionic info:

Your system information:
Cordova CLI: 6.5.0
Ionic Framework Version: 2.3.0
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
Ionic App Scripts Version: 1.2.2
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Linux 4.8
Node Version: v7.7.4
Xcode version: Not installed

Same for me, ionic serve hangs forever. Even reinstall on fresh ubuntu16 image but it did not help.

ionic info

Your system information:

Cordova CLI: 5.4.1
Ionic Framework Version: 2.3.0
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
Ionic App Scripts Version: 1.2.2
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Linux 4.8
Node Version: v6.10.1
Xcode version: Not installed

milan@milan-VirtualBox:~/pok/myapp$ ionic serve

ionic-hello-world@ ionic:serve /home/milan/pok/myapp
ionic-app-scripts serve “–v2” “–address” “0.0.0.0” “–port” “8100” “–livereload-port” “35729”

Exactly the same problem!

Your system information:

Cordova CLI: 6.5.0
Ionic Framework Version: 2.3.0
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
Ionic App Scripts Version: 1.2.2
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Linux 4.4
Node Version: v6.10.1
Xcode version: Not installed

The ionic-app-scripts shell script is broken on linux.
Fixed in github (https://github.com/driftyco/ionic-app-scripts/commit/0999f234ee1f9904159750a25b88080c65ccea62)
So downgrade to 1.1.4, wait for next version, use the github version or manually edit the script in your node_modules/.bin directory

2 Likes

Just to make things clearer, you can run:

npm install @ionic/app-scripts@1.1.4

to downgrade Ionic App Scripts to 1.1.4, as suggested by @jorrit_wh (and it does work).