BlueBell's answer is right, you can do it by:
npm uninstall cordova ionic
Are you planning to re-install it? If you feel something's wrong which is causing problems then you should update npm and clean npm's cache.
npm cache clean -f
npm install npm -g
If problems still persist, I'd suggest re-install of NPM and Node.
npm uninstall node
apt-get purge npm
apt-get install npm
npm install node -g
Let me know if you face issues in the process.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…