How to solve: Detected locally installed Ionic CLI, but it's too old--using global CLI?


I am getting this:

Detected locally installed Ionic CLI, but it’s too old–using global CLI.

How can I solve this? What should I do?

[WARN] Detected locally installed Ionic CLI, but it's to old--using global CLI

It means you have Ionic cli package locally installed in your project and it’s old.


"ionic": "<some version>"

If you are not using it from there (99% chances you are not), just remove it:

npm rm ionic --save


What if I do use it? How can I update it?


To use local Ionic cli (the one you installed through npm in your current directory) you need to add some changes to your environment. In your ~/.bashrc (Linux) ~/.bash_profile (Mac) you need to add ./node_modules/.bin directory:

export NODE_LOCAL="./node_modules/.bin"
set +h # This is required to avoid path cache of commands

Restart the terminal and that’s all:

shamank@Paula:~$ which ionic
shamank@Paula:~$ cd my-ionic-project
shamank@Paula:~/my-ionic-project$ which ionic

If you do that, I recommend you to use also local “cordova” because old versions are not compatible with latest Cordova (>7): npm i cordova@6.5.0 --save (or some version you need to work with your local old ionic cli).


Thank you, appreciated!


Works like a charm. Thanks :smiley: