Ionic serve not working in Ionic 3

2019-02-21 00:25发布

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.

17条回答
可以哭但决不认输i
2楼-- · 2019-02-21 00:50

I think your prob is the

NODE version (6.9.1) .. 

can you just try to upgrade to 9.1.0 or more?

查看更多
我只想做你的唯一
3楼-- · 2019-02-21 00:51

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

查看更多
趁早两清
4楼-- · 2019-02-21 00:53

Please use these commands in your project.

sudo sysctl fs.inotify.max_user_watches=524288

sudo sysctl -p --system

And again run ionic serve

查看更多
老娘就宠你
5楼-- · 2019-02-21 00:56

Have you tried using this cmd

npm run ionic:serve

查看更多
神经病院院长
6楼-- · 2019-02-21 00:59

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.

查看更多
趁早两清
7楼-- · 2019-02-21 01:00

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
查看更多
登录 后发表回答