Ionic serve - default port

I was having trouble accessing the Ionic dev server from some of my iOS devices. I finally determined that the port was the issue. Explicitly specifying a different port number seemed to fix the issue, so I did some quick googling of port 8100 (the default Ionic dev server port). It looks like port 8100 is used by iTunes for streaming, which is probably what was causing the problem. With this in mind, maybe the default Ionic dev server port should be changed.

1 Like

Yeah we can change the port if it causes issues at 8100.

Suggestions for the default port?

The angualr.js tutorial uses 8000

Can the port be configured with a bash environment variable? For those with a conflicting use, that would be a welcome improvement to providing a non-default port number every time $ionic serve is run.

port can be configure in package.js as serve script like this

"scripts": {
    "start": "ionic-app-scripts serve -p 4200"
}

Now you don’t need to write port each time, just user “npm start”