Arno
Arno

Reputation: 101

"ionic : command not found" on Mac after install ionic Cordova

I try to install ionic 4 on my iMac. I use this : npm install -g ionic Cordova

when I use ionic command I have this error : " ionic : command not found "

At the end I have this : + [email protected] + [email protected]

and when I try to use some Cordova command it work.

Upvotes: 1

Views: 3173

Answers (1)

Edo Udoma
Edo Udoma

Reputation: 131

From your question, I see you have installed node, cordova, ionic already to resolve error : " ionic : command not found" Try this out: 1. check your:

npm root
  1. check:

    npm root -g

You should have something like: "/usr/local"

  1. If your result is different, then that is where your problem is coming from.

Change it using:

npm config set prefix /usr/local
  1. Your can check your result with:

    npm root -g

  2. You should have something like

"/usr/local/lib/node_modules"

  1. You can now re-install everything with "-g"

    sudo npm install -g cordova

    sudo npm install -g ionic

If you still have the previous installation, please remember to uninstall first be re-installation with:

sudo npm uninstall -g cordova

sudo npm uninstall -g ionic

Upvotes: 5

Related Questions