0

I installd ionic using: npm install

-g cordova ionic 

and created a tabs project using:

ionic start myApp tabs

Then I used:

ionic serve

to see the app on the browser which is Google Chrome. It opened to a url localhost:8100 but it cannot load the page.

UPDATE:

Well, I discovered something i tried changing the address to my wifi address using 'ionic address'. I accessed the app using my PC's browsers(everything). The when I accessed it using my phone's browser. It worked. What do you think is the problem?

Jiji
  • 1,092
  • 3
  • 15
  • 36
  • Can upload an image to see your error clearly? – trungk18 Jul 18 '16 at 08:19
  • @trungk18 there's no error. The localhost:8100 just doesn't load any page. – Jiji Jul 18 '16 at 14:34
  • Can you open localhost:8100 on Chrome with Developer Tool to see If there are any missing file ? – trungk18 Jul 18 '16 at 14:37
  • I don't know how to do that. Chrome console says: GET http://localhost:8100/ net::ERR_CONNECTION_TIMED_OUT – Jiji Jul 18 '16 at 15:02
  • It is probably because of you have already close the console while you are trying to open the localhost:8100. After run ionic serve, did you close the cmd ? You have to keep it to active live reloading. – trungk18 Jul 18 '16 at 15:12
  • @trungk18 No, i didn't close cmd. It automatically loads the url but still says connection time out. – Jiji Jul 18 '16 at 15:16
  • Still not easy to conclude. Have you tried create another project with another template ? – trungk18 Jul 18 '16 at 15:23
  • @trungk18 yes, i tried sidemenu, blank and tabs. But still not loading. – Jiji Jul 18 '16 at 15:24
  • What I can suggest you now for save time is remove ionic completely and install it again. – trungk18 Jul 18 '16 at 15:25
  • i used the code npm uninstall cordova ionic but it didn't uninstall it. – Jiji Jul 19 '16 at 01:04
  • try this one for uninstalling and re-install again. http://stackoverflow.com/questions/29428929/how-do-you-completely-remove-ionic-and-cordova-installation-from-mac – trungk18 Jul 19 '16 at 01:14
  • for remove ionic follow: http://stackoverflow.com/questions/29428929/how-do-you-completely-remove-ionic-and-cordova-installation-from-mac if you are using mac machine please tyoe "sudo" before all commands. – Naitik Jul 19 '16 at 06:03
  • i uninstalled all. Deleted the modules and downloaded a new version of node js but still when I got all back, still not working. – Jiji Jul 19 '16 at 08:51
  • @trungk18 Well, I discovere something i tried changing the address to my wifi address using 'ionic address'. I accessed the app using my PC's browsers(everything). The when I accessed it using my phone's browser. It worked. What do you think is the problem? – Jiji Jul 19 '16 at 18:07
  • What do you mean by 'ionic address'? Seem you changed the ip address of your wifi to it, but what is this ? :D – trungk18 Jul 20 '16 at 07:26
  • @trungk18 instead of using my localhost ip, i used my wifi's ip. And tried to access the project using my phone and it worked. But my pc still cannot load the project. – Jiji Jul 21 '16 at 02:30

1 Answers1

0

You need to follow tasks:

1) npm install -g cordova ionic .

2) ionic start myApp tabs

3) cd myApp

4) ionic serve

you missed 3rd point cd myApp

Please fire all above command if still issue persist try to debugg error in browser console and update your question.

Thank you.

Naitik
  • 1,455
  • 15
  • 26
  • I didn't miss that sorry. When I run ionic serve, the browser directs me to localhost:8100, but it don't load any page. – Jiji Jul 18 '16 at 14:33
  • The console says: GET http://localhost:8100/ net::ERR_CONNECTION_TIMED_OUT – Jiji Jul 18 '16 at 15:02
  • have you add whitelist plugin? – Naitik Jul 19 '16 at 05:56
  • if not please follow https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-whitelist/ – Naitik Jul 19 '16 at 05:57
  • it's for security enable disable one.. please go through above link for more info... – Naitik Jul 19 '16 at 08:51
  • Why do I have to put that? My friend was able to view his app without any edits. – Jiji Jul 19 '16 at 08:56
  • Well, I discovere something i tried changing the address to my wifi address using 'ionic address'. I accessed the app using my PC's browsers(everything). The when I accessed it using my phone's browser. It worked. What do you think is the problem? – Jiji Jul 19 '16 at 18:07
  • That may be your machine's firewall issue.. i go throguh some links for trying to solve your issue i found one isssue happend with firewall of system..can't exactly tell you but it may be cause.. i glad that you resolve your problem.. happy coding.. cheers... – Naitik Jul 19 '16 at 18:12
  • Well I still haven't solved it. Well I will try to close my firewall. Thanks – Jiji Jul 19 '16 at 18:21