First, make sure that you have installed node.js 8.X and npm 5.X version. You can check it on your terminal window by merely entering node -v and npm -v. You can also download latest nodeJs from here
$ npm -v$ node -v
once node and npm installed on your machine, we need to install Ionic globally as well.
// You can install ionic globally on your machine npm install -g @angular/cli
Once Angular CLI install successfully verify the installation with this command
ng -v // it will show you the version of angualr-cli on your machine.
You might receive some other git related Error or node-sass as well .
If you get this error, please check if git was installed on your machine and if you are window user git should be in your path of the device
If there any error related to node-sass you may follow the guide based on your machine OS and most of the case window user might face issue then you can install Python 2.X on your machine, and it probably resolves your Error.