Ionic framework - the grunt serve command returns "several available addresses" and freezes

Yeoman Ion Generator https://github.com/diegonetto/generator-ionic

Where I ran it without sass, a list of plugins by default and empty.

And when I start the grunt service, I get the following:

Multiple addresses available. Please select which address to use by entering its number from the list below: 1) 192.168.1.69 (en0) 2) localhost Address Selection: 

When I type 2 in the terminal and return it, it just hangs there, without going further or starting the browser.

I also tried typing localhost or "localhost" and returning, still nothing hangs ...

I'm so confused, why?

Any help on this would be greatly appreciated, thanks.

+5
source share
3 answers

This morning I ran into the same problem as you. I look into the Ionic input code (. \ Node_modules \ ionic \ lib \ ionic \ serve.js) and compare it with another file, I did not find the difference. So instead of using the grunt serve command, I tried the ion feed command. This script did not depend on the command line, so I could select the address. (in my case, I selected 2 (localhost)).

From this moment, it remembers the option you have selected. therefore, you can run the grunt serve command again.

If the ion feed command does not work, try installing ionic: "npm install -g ionic"

+6
source

Edit the ionic.config file in: (Mac) ~ / .ionic or (Win) c: /users/username/.ionic
add: "ionicServeAddress": "localhost" to the configuration file

It will automatically select the local host, and then "grunt serve" will not ask for the address.
I found a solution here: fooobar.com/questions/152203 / ...

+6
source

The reason is that Grunt Watch is running, it will block the terminal from other work, so we can not do anything when Grunt Watch is running. Perhaps you can disconnect the Internet from Wi-Fi and disconnect all Lan cables to the computer to make sure that you have only one local IP address and start the grunt service. After that, you can reconnect it all. Another solution is that you may need to set a timeout in serve.js in the ion library to automatically assign a choice for us or events by deleting the step of selecting a multiple IP address by automatically assigning it to localhost.

0
source

Source: https://habr.com/ru/post/1204237/


All Articles