Ok I got it working. What i did was install homebrew and then took node off with it and then reinstalled everything.. installing node with homebrew then
$ npm install -g ionic
and then finally
$ npm install -g cordova ionic
and i dont get those errors anymore