ionic-cli icon indicating copy to clipboard operation
ionic-cli copied to clipboard

Ionic serve error: Error: ENOENT: no such file or directory, open '/home/.../IonicTest/www/index.html'

Open pdrosos opened this issue 10 years ago • 63 comments

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

pdrosos avatar Sep 28 '16 10:09 pdrosos

Hi having while creating a project

my installed versions are node 8.6.0 nodejs 8.6.0 npm 5.3.0

what should I do?

prasad456 avatar Oct 04 '17 10:10 prasad456

Hi, I am still having this problem and is really VERY frustrating.......any can help ?

capture

my ionic info ` cli packages: (C:\Users\monako\AppData\Roaming\npm\node_modules)

@ionic/cli-utils  : 1.13.1
ionic (Ionic CLI) : 3.13.2

global packages:

cordova (Cordova CLI) : 7.1.0

local packages:

@ionic/app-scripts : 3.0.0
Cordova Platforms  : android 6.3.0
Ionic Framework    : ionic-angular 3.7.1

System:

Android SDK Tools : 25.2.5
Node              : v8.7.0
npm               : 2.15.12
OS                : Windows 10

Misc:

backend : pro`

Nigrito avatar Oct 20 '17 21:10 Nigrito

If it helps anyone, in my case the error similar to that mentioned was caused by having the following in a block commented ( as in inside.. /* */ ) section of code. The comment was in a Provider, and had nothing to do with the boiler plate setup.. it was just being parked towards the base of my script as reference for something I was working on.

@Component({

selector: 'page-home',
templateUrl: 'home.html'
})

I narrowed it down to removing this chunk of code causing the issue to disappear, even though there was a still a lot of other code left in the block comment.

There was no use of any build command between removing and putting it back, seeing the error disappear, then appear again when the code was present.. just running

ionic serve --platform="ios"

So, worthwhile checking to see if you have anything lingering around in your comments that is magically being plucked out and processed during serve or build. If there's a reason why the above is meant to happen, i.e. the block comment is seemingly ignored, I'd be interested to know.

seanbrice avatar Oct 23 '17 17:10 seanbrice