Resolving Ionic serve no index.html in www folder error

November 26, 2016, 2:51 pm Categories:

Categories

Solving the Error

So you've upgraded to the latest version of Ionic 2, all your software dependencies are up to date and there are no problems running software on your OS yet, when you try to run your project in the browser using ionic serve, you are greeted with the following error:

Error: ENOENT: no such file or directory, open '/projects/myApp/www/index.html'

What gives?

Truth be told - I have no idea.

I suspect, as Ionic 2 is still in development (even at its current release candidate stage), that there may be some bugs when upgrading from one version of the software to the next.

Whatever the cause simply uninstalling and reinstalling Ionic 2 fixed the problem. Similar to the analogy of switching the computer off and on again this was the only solution I found that worked.

So if you find yourself experiencing the same issue and can't seem to fix it then, at your own risk, run the following commands - one after the other - in your console of choice (if you're using a unix based system you may have to prefix these commands with sudo should you encounter permission based errors):

npm uninstall -g ionic
npm install -g ionic cordova

Once Ionic 2 is successfully re-installed you should be able to run the ionic serve command without seeing the following error displayed in the browser:

Error: ENOENT: no such file or directory, open '/projects/myApp/www/index.html'

Summary

As we all know - development is never perfect, no matter the tools that are used, and there'll always be some frustrating bug or issue like the above that we encounter along the way.

Hopefully, if you are experiencing the no index.html page error, uninstalling and reinstalling Ionic 2 should fix this.

If you're interested in more troubleshooting tips for Ionic 2 development check out my new e-book: Mastering Ionic 2.

Tags

Categories

Post a comment

All comments are welcome and the rules are simple - be nice and do NOT engage in trolling, spamming, abusiveness or illegal behaviour. If you fail to observe these rules you will be permanently banned from being able to comment.

Top