1

My Ionic info:

cli packages: (/usr/lib/node_modules)

@ionic/cli-utils  : 1.9.2
ionic (Ionic CLI) : 3.9.2

global packages:

Cordova CLI : 7.0.1 

local packages:

@ionic/app-scripts : 3.1.0
Cordova Platforms  : browser 4.1.0
Ionic Framework    : ionic-angular 3.9.2

System:

Node : v6.9.0
npm  : 3.10.8 
OS   : Linux 4.4

Ionic serve is working fine, but does not detect any file changes!

The problem appears only for Ionic v3 and v2 projects.

My Ionic v1 projects are working fine.

Sotiris Kiritsis
  • 3,178
  • 3
  • 23
  • 31
Mebin Xtapps
  • 51
  • 1
  • 1
  • 8

20 Answers20

3

For update changes in platform file you have to run ionic cordova prepare and then run ionic serve it works.. ionic cordova prepare copy all files of www into platform directory that will reflect in your apk or ipa

PravinSanghani
  • 129
  • 1
  • 5
3

When I use ionic cli build app(ionic3 + angular5),same problem happened to me.I updated '@ionic/app-scripts' to version '3.1.6',then problem solved

Lili
  • 1
  • 3
3

Try like this

ionic serve --verbose =>didn’t work, there were errors;

npm run ionic:build --verbose =>ran, finnished with OK.

core114
  • 5,155
  • 16
  • 92
  • 189
1

Use "npm install" and then "gulp build" & "gulp serve". Also make sure you update all the dependencies. Check versions of your dependencies by "ionic info".

CThakur
  • 136
  • 8
1

Try npm run ionic:serve. Similar issue occurred when installing the latest cordova update.

alchi baucha
  • 930
  • 7
  • 17
1

Try below steps.. May be it will help

npm install -g ionic@latest

npm install @ionic/app-scripts@latest --save-dev

npm install ionic-angular@latest --save

ionic serve
DaFois
  • 2,197
  • 8
  • 26
  • 43
Pawwa
  • 43
  • 9
1

Please use these commands in your project.

sudo sysctl fs.inotify.max_user_watches=524288

sudo sysctl -p --system

And again run ionic serve

1

Delete the node_modules folder and then use the command

npm install

followed by

ionic serve--verbose

Hope that it works fine.

zx485
  • 28,498
  • 28
  • 50
  • 59
1

i faced this problem before ,try this instead of ionic serve :

npm run ionic:serve
Ali Mhanna
  • 401
  • 3
  • 14
0

You should not use "sudo" with any of the ionic/npm commands. If it throws error without "sudo", then you can fix it by changing the owner of the npm packages, using the command below:

sudo chown -R $(whoami) ~/.npm

Charles Zhao
  • 158
  • 11
0

my configurations for running ionic 3 application:

cli packages: (/usr/local/lib/node_modules)

@ionic/cli-utils  : 1.19.1
ionic (Ionic CLI) : 3.19.1

global packages:

cordova (Cordova CLI) : 8.0.0 

local packages:

@ionic/app-scripts : 3.1.7
Cordova Platforms  : android 6.3.0
Ionic Framework    : ionic-angular 3.9.2

System:

Android SDK Tools : 26.1.1
Node              : v8.2.1
npm               : 5.5.0 
OS                : Linux 4.4

Environment Variables:

ANDROID_HOME : /root/Android/Sdk

Misc:

backend : pro
0

Use these commands in your prompt.

npm cache clear --force
rm -rf node_modules/
npm install -d
CertainPerformance
  • 356,069
  • 52
  • 309
  • 320
0

Install ws:

npm install ws@3.3.2 --save-dev --save-exact
anothernode
  • 5,100
  • 13
  • 43
  • 62
0

In ionic 3 you have to type:

  • cordova run android or cordova run ios, to deploy your build in device.

  • cordova build android or cordova build ios, for build only.

Nils
  • 2,665
  • 15
  • 30
Ashay
  • 43
  • 7
0

Have you tried using this cmd

npm run ionic:serve

0

I think your prob is the

NODE version (6.9.1) .. 

can you just try to upgrade to 9.1.0 or more?

federico scamuzzi
  • 3,708
  • 1
  • 17
  • 24
0

My answers works. My machine is also having a different package of Node which I forgot about in the first place.

So I've removed node_modules using:

sudo rm -rf /opt/local/bin/node /opt/local/include/node /opt/local/lib/node_modules
sudo rm -rf /usr/local/bin/npm /usr/local/share/man/man1/node.1 /usr/local/lib/dtrace/node.

To make things less complicated with all cli - head up back https://nodejs.org/ and install back the LTS package

Uninstall Node from brew
re-install node.js using conventional way using the installer

Artjom B.
  • 61,146
  • 24
  • 125
  • 222
0

Include below script in the package.json file

"browser": "ionic-app-scripts serve --sourceMap source-map --iscordovaserve --wwwDir platforms/browser/www/ --buildDir platforms/browser/www/build"
and run

After It Run npm run browser

Sandip Moradiya
  • 706
  • 1
  • 11
  • 30
0

I have faced such a problem, tried a fresh new app, worked perfectly, tried another old app, also worked perfectly.

Tried to stop using some modules (clipboard in my case and another one), solved the problem, in my case it was an error in the way I am importing or using it.

ionic 5 is my ionic version

Hope this will help someone

Galilo Galilo
  • 519
  • 5
  • 22
0

What Worked for me was repairing the project ionic repair , then I ran ionic serve and it worked fine. Hope this solves your problem.

Basil Basaif
  • 362
  • 8
  • 20