Everything was working fine on CLI 1.5.2 (I don't know exactly what version I used).
Today I updated to CLI 1.5.5. After updating CLI didn't want to start. I had to upgrade Node, from v10 to latest. I downloaded the latest version from Nodejs.org (v12.4).
Then more troubles, so I uninstalled Ionic and reinstalled again. This is the ionic info:
Cordova CLI: 5.0.0
Gulp version: CLI version 3.9.0
Gulp local: Local version 3.9.0
Ionic Version: 1.0.0
Ionic CLI Version: 1.5.5
Ionic App Lib Version: 0.2.2
OS: Windows 8.1
Node Version: v0.12.4
That looks I think, however, it takes about 3 minutes after this Console output before the website opens:
D:\Develop_\App>ionic serve -p 8110
Gulp startup tasks: [ 'sass', 'watch' ]
[02:04:44] Using gulpfile D:\Develop_\App\gulpfile.js
[02:04:44] Starting 'sass'...
[02:04:45] Starting 'watch'...
[02:04:45] Finished 'watch' after 13 ms
[02:04:46] Finished 'sass' after 1.58 s
And the whole time the Evented I/O for V8 Javascript process runs at ~ 35% CPU (Windows).
When the website is opened, the system idles, but this process still takes ~25% CPU.
No errors, warnings or whatever. I read some guy downgraded CLI, but I don't know if that would help. Also, I don't know how to downgrade. I also deleted the projects node_modules folder and ran npm install again.
Strange thing is that another project I had just works. What could be different?
So, I haven't figured out the problem, but it seems the same problem this guy is having:
http://forum.ionicframework.com/t/ionic-cli-1-5-2-update-running-really-really-slow-cpu-at-90/26448
I uninstalled ionic (npm uninstall ionic -g) and reinstalled with (npm install [email protected] -g) and now it works again.
However, it seems there is some problem with the versions >1.5.0 (I also tried 1.5.2 with same problem).
My current ionic info:
Cordova CLI: 5.0.0
Gulp version: CLI version 3.9.0
Gulp local: Local version 3.9.0
Ionic Version: 1.0.0
Ionic CLI Version: 1.5.0
Ionic App Lib Version: 0.1.0
OS: Windows 8.1
Node Version: v0.12.4
I'm also facing same problem in OSX. Ionic process takes 65% of cpu (both ionic serve & emulate command). Here is my system info:
Cordova CLI: 5.0.0
Gulp version: CLI version 3.8.11
Gulp local: Local version 3.9.0
Ionic Version: 1.0.0
Ionic CLI Version: 1.5.5
Ionic App Lib Version: 0.2.2
ios-deploy version: 1.7.0
ios-sim version: 3.1.1
OS: Mac OS X Yosemite
Node Version: v0.12.2
Xcode version: Xcode 6.3.2 Build version 6D2105
Disabling the livereload on the CLI solved the slow CLI, not sure why yet:
ionic serve --verbose --nolivereload
Thanks @mark-veenstra, that fixed it for me too, but it would be nice to have livereload back. :/
Yep, ionic serve uses 100% CPU core using live-reload
Cordova CLI: 5.4.1
Gulp version: CLI version 3.9.0
Gulp local:
Ionic Version: 1.2.4-nightly-1967
Ionic CLI Version: 1.7.12
Ionic App Lib Version: 0.6.5
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Mac OS X El Capitan
Node Version: v5.3.0
Xcode version: Xcode 7.2 Build version 7C68
I face the same problem with ionic 2.0.0-beta.22.
ionic serve consumes 100% cpu.
adding --nolivereload fixed the problem.
my OS: 32bit ubuntu 14.04, node version: v0.12.7
@petervojtek What worked for me is setting the livereload interval from the default value (100 ms?) to 500 ms. You could try that. And btw, update your node version (if possible).
{interval: 500} in the config somewhere (I can't remember where exactly).
@DHFW thanks for hint.
the problem remains after updating node from v0.12.x to v5.8.0.
I managed to locate an interval somewhere in node_modules/gulp_watch (default value 100), but setting it to 500 made no difference (still 100% CPU occupied).
And actually after updating to node5.8 following behaviour started to appear:
ionic serve
WARN: ionic.config.js has been deprecated, you can remove it.
WARN: No gulpfile found!
If your app requires a build step, you may want to ensure it runs before serve.
Looks like you are using the deprecated ionic.config.js and have no gulpfile!
As of beta.21 the Ionic CLI relies on gulp hooks to build your web assets
? Would you like to download the default gulpfile? Yes
WARN: ionic.config.js has been deprecated, you can remove it.
Downloading default gulpfile from: https://cdn.rawgit.com/driftyco/ionic2-app-base/typescript/gulpfile.js
✓ Successfully downloaded gulpfile. Try running 'serve' again.
when I run again ionic serve, I again see the same WARN: No gulpfile found! and question if I want to download it (again?).
When I answer No instead of Yes, ionic serve will start serving the gui on port 8100, but without live reload.
@petervojtek any way you could share your project setup? Sounds like a bug that it can't find the gulpfile after it's downloaded
I'm having the same problem as petervojtek
Cordova CLI: Not installed
Ionic Version: 2.0.0-beta.3
Ionic CLI Version: 2.0.0-beta.22
Ionic App Lib Version: 2.0.0-beta.12
OS: Distributor ID: Ubuntu Description: Ubuntu 14.04.3 LTS
Node Version: v5.4.1
And here is the actual project from a newly created ionic start --v2
I started having this problem after I added a decent number of images to www/img. If I had to guess the live reload is checking these files for changes and since they are images and there are hundreds it kills the frame-rates of the live reload.
Following the advice here fixed my problem:
http://stackoverflow.com/questions/26240342/ionic-livereload-how-to-ignore-some-files
as I was able to simple just add "!www/img/*" to ionic.project.watchPatterns.
I would suggest to any others who are experience ionic live reload lag to determine which directories or files are the most likely causing the lag and add ignore them in ionic.project.
Hope this helps!
Here are details on the workaround - you want to add {interval: 1000} to this line: https://github.com/driftyco/ionic-app-lib/blob/master/lib/serve.js#L307
Usually it will be located in your local project ionic install at: <your_project>\node_modules\ionic\node_modules\ionic-app-lib\lib\serve.js
I can also confirm this is fixed in ionic-cli 2.x.x (tried on latest).
still have the same issue, my enviroment is:
Cordova CLI: 6.1.1
Gulp version: CLI version 3.9.1
Gulp local: Local version 3.9.1
Ionic Framework Version: 2.0.0-beta.6
Ionic CLI Version: 2.0.0-beta.25
Ionic App Lib Version: 2.0.0-beta.15
OS: Windows 8.1
Node Version: v4.4.4
and it take about 3 min to start :: ionic build android !!! and around 20 sec for the ionic info to show the result
106% CPU... ignoring images did not help
ah, it does not accept normal globbing syntax for ! i had to use
"watchPatterns": ["www/**/*.js", "www/**/*.html","www/**/*.css"]
to only watch given extensions.
Hello all! After testing this does not seem to be an issue with the latest cli. Thanks for using Ionic!
@jgw96 what version of latest cli are you referring to? Unless the watch mechanism changed from interval polling to events, this problem will be still there.
This might be related: https://github.com/driftyco/ionic-app-lib/pull/117
I have the same problem when I use ionic serve command
Your system information:
Cordova CLI: 6.3.1
Gulp version: CLI version 3.9.1
Gulp local:
Ionic Framework Version: 2.0.0-rc.1
Ionic CLI Version: 2.1.1
Ionic App Lib Version: 2.1.1
Ionic App Scripts Version: 0.0.36
ios-deploy version: 1.8.5
ios-sim version: 5.0.6
OS: Mac OS X Sierra
Node Version: v5.12.0
Xcode version: Xcode 8.0 Build version 8A218a
When I execute ionic serve --nolivereload is OK.
I had similar issues when I had accidentally created a large file structure in the folder ionic was watching for live reloads - keeping the number of files / folders that ionic is watching for live-reload purposes low seems to improve performance quite a bit.
I had similar problem, and the problem was that I had only about 10GB disk space free - you need more than 25GB apparently.
I had this same problem and additionally had a problem with my IDE (Webstorm) slowing down. I tried @gillarf 's suggestion after which my IDE stopped freezing, though the CPU % i still very high, around 74%. I do have 22 pages, so about 90 files in my app at the moment, not including the icons in my resources directory.
Hi @kentoj - I also found that my anti-virus software was a big problem. I had kaspersky installed and stopping that made ionic commands run even quicker.
Most helpful comment
I started having this problem after I added a decent number of images to www/img. If I had to guess the live reload is checking these files for changes and since they are images and there are hundreds it kills the frame-rates of the live reload.
Following the advice here fixed my problem:
http://stackoverflow.com/questions/26240342/ionic-livereload-how-to-ignore-some-files
as I was able to simple just add
"!www/img/*"to ionic.project.watchPatterns.I would suggest to any others who are experience ionic live reload lag to determine which directories or files are the most likely causing the lag and add ignore them in ionic.project.
Hope this helps!