Ionic serve failed after updating to rc3


#1

Hi, after updating to rc3 and starting a new project I got an error:

ionic-app-scripts serve

[20:05:16] ionic-app-scripts 0.0.45
[20:05:17] watch started …
[20:05:17] build dev started …
[20:05:17] clean started …
[20:05:17] clean finished in 10 ms
[20:05:17] copy started …
[20:05:17] transpile started …
events.js:160
throw er; // Unhandled ‘error’ event
^

Error: listen EADDRINUSE 0.0.0.0:53703
at Object.exports._errnoException (util.js:1026:11)
at exports._exceptionWithHostPort (util.js:1049:20)
at Server._listen2 (net.js:1257:14)
at listen (net.js:1293:10)
at net.js:1403:9
at _combinedTickCallback (internal/process/next_tick.js:77:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
at Module.runMain (module.js:606:11)
at run (bootstrap_node.js:394:7)
at startup (bootstrap_node.js:149:9)

I have tried to reinstall ionic CLI and all dependencies - no result.
Any tips?

Cordova CLI: 6.4.0
Ionic Framework Version: 2.0.0-rc.3
Ionic CLI Version: 2.1.12
Ionic App Lib Version: 2.1.7
Ionic App Scripts Version: 0.0.45
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Windows 7
Node Version: v6.9.1


#2

Did you update everything like described in the blog post? Seems that you didn’t upgraded app-script at least (your version 0.0.45, last version 0.0.46)

http://blog.ionic.io/rc3-error-reporting-final-oh-my/


#3

Yes, now I have the latest script 0.0.46, no changes:

[20:22:36]  ionic-app-scripts 0.0.46
[20:22:36]  watch started ...
[20:22:36]  build dev started ...
[20:22:36]  clean started ...
[20:22:36]  clean finished in 1 ms
[20:22:36]  copy started ...
[20:22:36]  transpile started ...
events.js:160
      throw er; // Unhandled 'error' event
      ^

Error: listen EADDRINUSE 0.0.0.0:53703
    at Object.exports._errnoException (util.js:1026:11)
    at exports._exceptionWithHostPort (util.js:1049:20)
    at Server._listen2 (net.js:1257:14)
    at listen (net.js:1293:10)
    at net.js:1403:9
    at _combinedTickCallback (internal/process/next_tick.js:77:11)
    at process._tickCallback (internal/process/next_tick.js:98:9)
    at Module.runMain (module.js:606:11)
    at run (bootstrap_node.js:394:7)
    at startup (bootstrap_node.js:149:9)

#4

Do you also have (in your package.json):

"dependencies": {
"@angular/common": "2.1.1",
"@angular/compiler": "2.1.1",
"@angular/compiler-cli": "2.1.1",
"@angular/core": "2.1.1",
"@angular/forms": "2.1.1",
"@angular/http": "2.1.1",
"@angular/platform-browser": "2.1.1",
"@angular/platform-browser-dynamic": "2.1.1",
"@angular/platform-server": "2.1.1",
"ionic-angular": "^2.0.0-rc.3",
"rxjs": "5.0.0-beta.12",
"ionic-native": "2.2.3",
"ionicons": "3.0.0",
"zone.js": "0.6.26"

If yes. Maybe delete node_modules and “npm install”?


#5

I did, than cleared cache, uninstalled ionic cli - no changes. The same problem occurs with a new project and with all my old, I think it should be something with the new ionic cli version. I wonder if there is a way to install an old cli version now?


#6

Hi, I am having the same issue when starting a blank project with RC3. https://github.com/driftyco/ionic/issues/9217 suggests a fix but the change already exists.

ionic -v = 2.1.12

I get a dependency warning asking me to install Cordova CLI >= 4.2.0 but cordova -v = 6.4.0

"scripts": {
"ionic:build": "ionic-app-scripts build",
"ionic:serve": "ionic-app-scripts serve"},

“dependencies”: {
"@angular/common": “2.1.1”,
"@angular/compiler": “2.1.1”,
"@angular/compiler-cli": “2.1.1”,
"@angular/core": “2.1.1”,
"@angular/forms": “2.1.1”,
"@angular/http": “2.1.1”,
"@angular/platform-browser": “2.1.1”,
"@angular/platform-browser-dynamic": “2.1.1”,
"@angular/platform-server": “2.1.1”,
"@ionic/storage": “1.1.6”,
“ionic-angular”: “2.0.0-rc.3”,
“ionic-native”: “2.2.3”,
“ionicons”: “3.0.0”,
“rxjs”: “5.0.0-beta.12”,
“zone.js”: “0.6.26”
},
“devDependencies”: {
"@ionic/app-scripts": “0.0.46”,
“typescript”: “2.0.6”
}


#7

Maybe a windows problem? Are you using nodejs 6 something (I guess it’s the supported version right?)

Otherwise sorry I don’t know, on my mac, I face no problem. Sorry :frowning:


#8

If needed I’ve got

"scripts": {
"ionic:build": "ionic-app-scripts build",
"ionic:serve": "ionic-app-scripts serve"
},

"dependencies": {
"@angular/common": "2.1.1",
"@angular/compiler": "2.1.1",
"@angular/compiler-cli": "2.1.1",
"@angular/core": "2.1.1",
"@angular/forms": "2.1.1",
"@angular/http": "2.1.1",
"@angular/platform-browser": "2.1.1",
"@angular/platform-browser-dynamic": "2.1.1",
"@angular/platform-server": "2.1.1",
"@ionic/storage": "1.1.6",
"angular2-swing": "^0.10.0",
"ionic-angular": "^2.0.0-rc.3",
"ionic-native": "2.2.3",
"ionicons": "3.0.0",
"rxjs": "5.0.0-beta.12",
"zone.js": "0.6.26"

},

"devDependencies": {
"@ionic/app-scripts": "0.0.46",

and tsconfig.json

{
"compilerOptions": {
    "allowSyntheticDefaultImports": true,
    "declaration": false,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "lib": [
        "dom",
        "es2015"
    ],
    "module": "es2015",
    "moduleResolution": "node",
    "sourceMap": true,
    "target": "es5",
    "removeComments": true
},
"include": [
    "src/**/*.ts"
],
"exclude": [
    "node_modules"
],
"compileOnSave": false,
"atom": {
    "rewriteTsconfig": false
}
}

#9

ok, I added a few lines in package.json:

 "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"
  }, 

and it works :slight_smile:

Thanks guys for your help!


#10

Hah, thanks but I just found an alternative solution! Installing Nodejs 7.1.0 worked although at first it threw a node-sass error (unsupported environment) but “npm rebuild node-sass” fixed that. Serve now works perfectly.


#11

I did as you described: update to the last node 7.1.0 and fixed sass error. Works! Thanks!


[INVALID] Upgrade to Node 7.0.0 => Warnings in webpack build
#12

I have the same problem but with at least for me with a strange behavior.

First of all, my ionic info details:

Your system information:

ordova CLI: 6.4.0
Ionic CLI Version: 2.1.17
Ionic App Lib Version: 2.1.7
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Windows 10
Node Version: v6.9.1
Xcode version: Not installed

  1. I created a new ionic 2 proyect and after that I executed ionic serve --lab without any problem.
  2. When I re run the ionic serve command, I got the error message that you describe.

If I delete the npm_modules folder, execute npm install I am again able to run ionic serve --lab but I fails in the following execution.


#13

Check whether any other Terminal is running other Applications on the same port. This happens when multiple applications trying to access the same port, Its always FIFO.


#14

Probably some other app is running in another terminal.
If yes, then you may try as mentioned in this post