Unable to run ionic 2 example app


#1

Hi,
I am trying to run a tutorial app from following link:

But I get this error when I run ‘ionic serve’ or ‘sudo ionic serve’:

BLRW3005131:TabbedApp Deepak$ ionic serve


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

Install ios-sim to deploy iOS applications.npm install -g ios-sim (may require sudo)
Install ios-deploy to deploy iOS applications to devices. npm install -g ios-deploy (may require sudo)


ionic-hello-world@ ionic:serve /Users/Deepak/Documents/ionicAngular2_Workspace/TabbedApp
ionic-app-scripts serve

[10:51:58] ionic-app-scripts 0.0.45
[10:51:59] watch started …
[10:51:59] build dev started …
[10:51:59] clean started …
[10:51:59] clean finished in less than 1 ms
[10:51:59] copy started …
[10:51:59] transpile started …
events.js:160
throw er; // Unhandled ‘error’ event
^

Error: listen EADDRINUSE 0.0.0.0:53703
at Object.exports._errnoException (util.js:1022:11)
at exports._exceptionWithHostPort (util.js:1045:20)
at Server._listen2 (net.js:1262:14)
at listen (net.js:1298:10)
at doListening (net.js:1397:7)
at _combinedTickCallback (internal/process/next_tick.js:77:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
at Module.runMain (module.js:607:11)
at run (bootstrap_node.js:420:7)
at startup (bootstrap_node.js:139:9)

npm ERR! Darwin 15.6.0
npm ERR! argv “/usr/local/bin/node” “/usr/local/bin/npm” “run” “ionic:serve” "–"
npm ERR! node v7.2.0
npm ERR! npm v3.10.9
npm ERR! code ELIFECYCLE
npm ERR! ionic-hello-world@ ionic:serve: ionic-app-scripts serve
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ionic-hello-world@ ionic:serve script ‘ionic-app-scripts serve’.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the ionic-hello-world package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! ionic-app-scripts serve
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs ionic-hello-world
npm ERR! Or if that isn’t available, you can get their info via:
npm ERR! npm owner ls ionic-hello-world
npm ERR! There is likely additional logging output above.
npm ERR! Darwin 15.6.0
npm ERR! argv “/usr/local/bin/node” “/usr/local/bin/npm” “run” “ionic:serve” "–"
npm ERR! node v7.2.0
npm ERR! npm v3.10.9
npm ERR! path npm-debug.log.1332571387
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall open

npm ERR! Error: EACCES: permission denied, open 'npm-debug.log.1332571387’
npm ERR! { Error: EACCES: permission denied, open 'npm-debug.log.1332571387’
npm ERR! errno: -13,
npm ERR! code: ‘EACCES’,
npm ERR! syscall: ‘open’,
npm ERR! path: ‘npm-debug.log.1332571387’ }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.

npm ERR! Please include the following file with any support request:
npm ERR! /Users/Deepak/Documents/ionicAngular2_Workspace/TabbedApp/npm-debug.log
There was an error serving your Ionic application: There was an error with the spawned command: serve
BLRW3005131:TabbedApp Deepak$

am I missing something here?


#2

ionic-cli #1678.


#3

That issue seems to persist if we try to serve 2 apps. However, in my case, I am serving only one app and getting that error.

I also happend to try the options given there:
ionic serve -p 8000 //did not work, it still threw same error

ionic serve --dev-logger-port 53704 --livereload-port 35730 --port 8200 // gave lot of warnings and then same error as above. However opened localhost:8200 in the browser, but with following message:

This site can’t be reached

localhost refused to connect.