Reputation: 51
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.
Upvotes: 1
Views: 12254
Reputation: 372
What Worked for me was repairing the project ionic repair
, then I ran ionic serve
and it worked fine. Hope this solves your problem.
Upvotes: 0
Reputation: 569
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
Upvotes: 0
Reputation: 397
i faced this problem before ,try this instead of ionic serve :
npm run ionic:serve
Upvotes: 1
Reputation: 726
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
Upvotes: 0
Reputation: 11
Delete the node_modules
folder and then use the command
npm install
followed by
ionic serve--verbose
Hope that it works fine.
Upvotes: 1
Reputation: 1
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
Upvotes: 0
Reputation: 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
Upvotes: 1
Reputation: 3778
I think your prob is the
NODE version (6.9.1) ..
can you just try to upgrade to 9.1.0 or more?
Upvotes: 0
Reputation: 43
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.
Upvotes: 0
Reputation: 43
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
Upvotes: 1
Reputation: 1
Install ws:
npm install [email protected] --save-dev --save-exact
Upvotes: 0
Reputation: 1
Use these commands in your prompt.
npm cache clear --force
rm -rf node_modules/
npm install -d
Upvotes: 0
Reputation: 1
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
Upvotes: 0
Reputation: 186
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
Upvotes: 0
Reputation: 5325
Try like this
ionic serve --verbose
=>didn’t work, there were errors;
npm run ionic:build --verbose
=>ran, finnished with OK.
Upvotes: 3
Reputation: 1
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
Upvotes: 3
Reputation: 1040
Try npm run ionic:serve. Similar issue occurred when installing the latest cordova update.
Upvotes: 1
Reputation: 129
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
Upvotes: 3
Reputation: 136
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".
Upvotes: 1