Error: ENOENT: no such file or directory, open '...\www\index.html'

Does the file exist?

@joshmorony - i followed all steps you mentioned but again same issue exist.

@alfabetagama - Yes, the file does not exist. What is the reason for this? How it can be solved?

You still need a basic app template, maybe run:

ionic start myApp tabs

Thanks @alfabetagama. I want to use ionic 2 not 1.

Add --v2 to the ionic start line. This creates a Ionic 2 app

It work for me. Thanks!

Main reason for this error is ionic cli version when you create a project with ionic 2 rc0 should be 2.1.0

But this doesnt work for me as well. I tried multiple times tried to uninstall and install ionic multiple times and my cli version remains to be 2.0.0-beta25 :frowning:

struggling with this for past 3 days :frowning:

Hi, I had exactly same issue and managed to solve it.

I am using Windows OS. Here are the steps what i did.

  1. Check the current npm directory that means when you installed ionic or cordova etc where it is installing.

  2. Then uninstall ionic and try to run ionic -v if you get version number then you have another old npm directory which already has ionic installed. In my case it was C:\Users{user name}\AppData\Roaming\npm\node_modules folder which was set as npm directory and older version of ionic was installed here.

  3. Reset npm directory to C:\Users{user name}\AppData\Roaming\npm\node_modules.

  4. Now uninstall cordova, ionic etc

  5. Reinstall again

  6. try to run ionic -v

  7. you are done!!

1 Like

@cpdas

I am not sure what is the difference in 2 different locations that you posted above as your 2 npm directories.

When it installed it installed for me in
C:\Users\Bala\AppData\Roaming\npm\node_modules

C:\Users\Bala>echo %PATH%
C:\Program Files (x86)\Common Files\Intel\Shared Files\cpp\bin\Intel64;C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Lenovo\FusionEngine;C:\Program Files (x86)\Intel\iCLS Client;C:\Program Files\Intel\iCLS Client;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\Program Files\Intel\Intel® Management Engine Components\DAL;C:\Program Files\Intel\Intel® Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel® Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel® Management Engine Components\IPT;C:\Program Files\Intel\WiFi\bin;C:\Program Files\Common Files\Intel\WirelessCommon;C:\Program Files (x86)\Common Files\lenovo\easyplussdk\bin;C:\Program Files\Java\jdk1.8.0_25\bin;C:\android\yoto\adt-bundle-windows-x86_64-20140702\adt-bundle-windows-x86_64-20140702\sdk\add-ons\addon-yotaphone\tools_win;C:\Program Files (x86)\Skype\Phone;C:\Program Files (x86)\Brackets\command;C:\Program Files (x86)\Fuse;C:\Program Files\Git\cmd;C:\WINDOWS\system32\config\systemprofile.dnx\bin;C:\Program Files\Microsoft DNX\Dnvm;C:\Program Files\Microsoft SQL Server\130\Tools\Binn;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit;C:\Program Files (x86)\nodejs;C:\Program Files (x86)\Diffuse;C:\Python34;C:\Python34\Scripts;C:\MinGW;C:\MinGW\bin;C:\MinGW\msys\1.0\bin;C:\Users\Bala\AppData\Local.meteor;C:\Users\Bala\AppData\Local\Android\sdk\platform-tools;C:\Users\Bala\AppData\Local\Android\sdk\tools;C:\ant\bin;C:\Users\Bala\AppData\Local\Code\bin;C:\Users\Bala\AppData\Local\atom\bin;C:\parse\parse.exe;C:\Program Files (x86)\Microsoft VS Code\bin;C:\Users\Bala\AppData\Local\Microsoft\WindowsApps;C:\Users\Bala\AppData\Roaming\npm

My NPM directory is set to be same as well.

I am not sure how to find out if there is another npm directory.

Installation

After uninstall:

Any tips would be highly appreciated.

Finally I managed to solve it… uffff.

if you get ionic -v even after uninstalling…

run where ionic and find out the location of your installtion.

for me there was a version installed in
C:>where ionic
C:\Program Files (x86)\nodejs\ionic
C:\Program Files (x86)\nodejs\ionic.cmd

I am not sure how it went there last time. but after manually deleting them, My ionic cli is now updated and my project is able to render in browser.

Thanks a lot

It’s related to https://forum.ionicframework.com/t/ionic-2-rc0-serve-and-run-screwed-up/65526

I get same error when serve/run breaks the compilation

Keep restarting your serve , if it builds then it would work :stuck_out_tongue:

1 Like

Thanks @joshmorony for your help, work for me.

There has nothing wrong with the Ionic version, these error cause by the lack of build script in package.json.

I use ionic start myproject tab --v2 and ionic start myproject tutorial --v2 command start two project, i found the package.json file are different.

In tab project, there is no "serve:before": "watch", script in package.json. there won’t build the necessary file before you run ionic serve

so make sure you have below script in your package.json:

“scripts”: {
“build”: “ionic-app-scripts build”,
“watch”: “ionic-app-scripts watch”,
“serve:before”: “watch”,
“emulate:before”: “build”,
“deploy:before”: “build”,
“build:before”: “build”,
“run:before”: “build”
},

Has anyone come up with a solution to this?

I have a fresh install of Node 7.2.1 and a fresh install of Cordova 6.3.1 and a fresh install of Ionic 2.1.0

Steps to reproduce the problem:

  1. ionic start myapp sidemenu --v2

  2. cd myapp

  3. npm install

  4. ionic serve

  5. Error: ENOENT: no such file or directory, open ‘/Users/brad/myapp/www/index.html’

Any help is appreciated.

Uninstall everything, and start from the beginning with the Node LTS.

Same issue after trying LTS version of node. I should mention, I have this “same” footprint on multiple machines and other machines are creating the index.html file fine.

It seems like a permissions issue or something like previous versions where the folder security was preventing it from writing.

I found another user here: https://github.com/driftyco/ionic-cli/issues/1420

Where everyone is jumping around trying to GUESS at what might be going on, as well as offering random advice that is not based on knowledge or fact.

They ran the following command and it will create the html file, but it does not solve the underlying issue of why running “Ionic start myapp” creates a broken app with no html file and other missing files.

npm run ionic:build

I would like to have access to a complete uninstall, reset of cache, complete reinstall of all necessary components (with builds), so that someone can effectively “start from scratch” and get something, anything working properly.

This is absolutely frustrating and I have 3 Macs here all installed with the same versions and same updates performed, but all 3 produce different versions of our app as well as different versions of the template “Sidemenu” and “Tabs” apps.

Here is the package.json contents:

{
“name”: “myapp”,
“author”: “Ionic Framework”,
“homepage”: “http://ionicframework.com/”,
“private”: true,
“scripts”: {
“ionic:build”: “ionic-app-scripts build”,
“ionic:serve”: “ionic-app-scripts serve”
},
“dependencies”: {
"@angular/common": “2.2.1”,
"@angular/compiler": “2.2.1”,
"@angular/compiler-cli": “2.2.1”,
"@angular/core": “2.2.1”,
"@angular/forms": “2.2.1”,
"@angular/http": “2.2.1”,
"@angular/platform-browser": “2.2.1”,
"@angular/platform-browser-dynamic": “2.2.1”,
"@angular/platform-server": “2.2.1”,
"@ionic/storage": “1.1.6”,
“ionic-angular”: “2.0.0-rc.4”,
“ionic-native”: “2.2.11”,
“ionicons”: “3.0.0”,
“rxjs”: “5.0.0-beta.12”,
“zone.js”: “0.6.26”
},
“devDependencies”: {
"@ionic/app-scripts": “0.0.47”,
“typescript”: “2.0.9”
},
“cordovaPlugins”: [
“cordova-plugin-device”,
“cordova-plugin-console”,
“cordova-plugin-whitelist”,
“cordova-plugin-splashscreen”,
“cordova-plugin-statusbar”,
“ionic-plugin-keyboard”
],
“cordovaPlatforms”: [
“ios”,
{
“platform”: “ios”,
“version”: “”,
“locator”: “ios”
}
],
“description”: “myapp: An Ionic project”
}

I am happy to share logs or whatever, if anyone can please help.

1 Like

Update: Possible Resolution for myself and hopefully others.

I am on a mac, so I went in and unhid my directories.
Open Terminal and use the following command:

defaults write com.apple.finder AppleShowAllFiles YES

Then, I went into the hard drive …finder “Macintosh HD”

usr -> local -> lib -> node_modules

I deleted the entire node_modules directory and reinstalled everything from scratch.

This worked for me and now I am running again. I hope this works for others out there. Good luck!

This is rapidly becoming a crusade for me, but if people would just STOP RUNNING NPM AS ROOT, you would not have to hunt all over filesystems to find things. nvm is your friend.

I am using node 7.0 still facing the same issue and index.html does not exist in the given path. I started a blank project does that suppose to mean index.html will be unavailable by default ?