Ionic serve error: Error: ENOENT: no such file or directory, open '/home/.../IonicTest/www/index.html'
Hi,
I have just removed the previous version of ionic cli and installed the new one: npm uninstall -g ionic npm cache clean npm install -g ionic
and started a new project: ionic start IonicTest --v2
The project is generated with the latest ionic-angular 2.0.0-rc.0, but when I go to the project directory and run ionic serve, I see an error in the browser: Error: ENOENT: no such file or directory, open '/home/pavlina/IonicTest/www/index.html'
CC @jgw96 @danbucholtz @brandyscarney
to be honnest I don't know I am not part of ionic team. I am just a developer like you.
@speedfl no problem. but after doing some research i found this blog http://blog.ionic.io/improvements-to-ionic-build-process/ everything looks ok but not able to see the gulp file run before lite-server runs.
It seems like the build is failing and note reporting the outcome correctly.
Can you update the following packages so we can troubleshoot this better?
npm install -g ionic@latest
npm install @ionic/app-scripts@latest
Can you also append a --debug to the npm script for ionic:serve so we can see additional logging? That may provide a hint.
Thanks, Da
@danbucholtz I got the out put i am using ubuntu16.04, So i forgot to use sudo command.
Now it is working fine thanks
I am doing everything I can get from here but is still facing the same issue. I am also having build error when trying to build for android. This is what I get
_
cache taskArtifacts.bin (/Volumes/My Passport/ionic/hello/platforms/android/.gradle/2.13/taskArtifacts/taskArtifacts.bin) is corrupt. Discarding. _
_
FAILURE: Build failed with an exception.
- What went wrong: Could not open cache taskArtifacts.bin (/Volumes/My Passport/ionic/hello/platforms/android/.gradle/2.13/taskArtifacts/taskArtifacts.bin).
Corrupted FreeListBlock 0 found in cache '/Volumes/My Passport/ionic/hello/platforms/android/.gradle/2.13/taskArtifacts/taskArtifacts.bin'.
- Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
_
Are this 2 issues related? I am really at a lost of what to do next.............any advice pls.........
No one ??...........
please try $ npm install ionic@latest -g $ npm install @ionic/app-scripts@latest --save-dev $ npm run ionic:build $ npm run ionic:serve
i also have the same problem, i have tried to send the above commands, i attach the screen of error received (screen is referred to "npm install @ionic/app-scripts@latest")

I solved with npm run ionic:build
Thanks @danbucholtz After one week of frustration. You save my day. Merry Xmas
solved by running npm run build Before ionic serve
I am getting this error, despite of trying all possible steps shown here, writing here after frustrated 2 hours:
Runtime Error
Module build failed: Error: ENOENT: no such file or directory, open '/Users/Documents/IonicMaster/src/pages/menuthree/menuthree.js' at Error (native)
Stack
Error: Module build failed: Error: ENOENT: no such file or directory, open '/Users/Documents/IonicMaster/src/pages/menuthree/menuthree.js'
at Error (native)
at Object.
Anyone know of any other solution, other then what is mentioned here.
Why it is looking for a .JS file instead of a .TS file
$ npm install ionic@latest -g $ npm install @ionic/app-scripts@latest --save-dev
the two commands above also fixes the live reload issue.
I do run the build first and then execute ionice serve. And it works fine for me.
And these are the commands:
npm run build
ionic serve
npm run build in project folder solved for me.
npm -v
3.10.10
$ cordova -v
6.5.0
$ ionic -v
2.2.1
$ node -v
v6.10.0
In my case the problem was caused by the fact that my project was in a subfolder of a NTSF junction on Windows.
E.g.: c:/works/my.ionic.project
Where works is a NTFS junction to a directory on the same drive.
npm run build cannot find all necessary files but doesn't report any error to the user.
Don't know if this is a NPM issue or a Ionic CLI issue, maybe @danbucholtz (or others Ionic team members) could figure it out...
EDIT: For some reason when I served from Node.js Cmd Prompt it worked, but from Git Bash it did not
I have had similar errors "Runtime Error Module build failed: Error: ENOENT: no such file or directory, open 'C:\Users\Youssef\Documents\App Dev\Ionic\Ionic CLI\Samples\tab-sample\tabApp3\src\app\main.js' at Error (native)"
My ionic info
Cordova CLI: 6.5.0
Ionic Framework Version: 3.0.1
Ionic CLI Version: 2.2.2
Ionic App Lib Version: 2.2.1
Ionic App Scripts Version: 1.3.3
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Windows 8.1
Node Version: v6.10.2
Xcode version: Not installed
I have tried running
npm install -g ionic@latest
npm install @ionic/app-scripts@latest
npm run ionic:build
npm run ionic:serve --debug
Here is the debug output that I think is causing the issue
Basically the wepack loader is failing to load main.js Any help is appreciated!
@jgw96 @danbucholtz @brandyscarney
@amity203 I had the same issue until I realised I was importing a component with a small typo
import {User} from "../models/user"
instead of
import {User} from "../models/User"
It was first when running ionic run android --device --prod I was presented with an error. The app worked without issues in the serve environment
Actually we are missing index.html file here-
www/index.html
just copy and paste index file to resolve this issue-
copy form src/index.html
paste here www/index.html
hopefully that will for for you as this worked for me.
also can see here on stack OverFlow
https://stackoverflow.com/questions/40669878/error-enoent-no-such-file-or-directory-open-in-ionic2