Errors trying to install Ionic



I’m trying to install cordova and ionic, after long struggeling i managed to install cordova, now i want to install ionic but i keep getting errors. I already tried all the solutions i could find but none seem to work. After some trying the error that i have now is already different from the error i had in the beginning. Now this is the error i have:

In the beginning this was the error i had:

If anyone knows a solution, it is more than welcome!