Ionic command not found after update ionic


I was playing with ionic (as usual) and i read “please update your ionic CLI”. (i’m on macOs env)

So i ran this command from my terminal :
sudo npm install -g ionic

Then i can’t use ionic anymore
ionic command not found

I crawl the web and i found the solution here

It sounds the npm root dir was changed when running npm install on my ionic app directory.

I hope it could help someone.

"ionic: command not found" After trying to update Ionic CLI

This was incredibly helpful! Thank you for this post :grin:


It finally works now. Thanks


I did the same as lucbonin suggested but it still gives me the error of
ionic command not found


This happened to me recently. I uninstalled Node and NPM, then reinstalled Node, NPM, and Ionic.