How to fully uninstall a CLI package entirely from your Mac

I installed zkapp-cli on node 19 using NVM but ran into an EACCESS Permission error while deploying my test project. To fix it, I modified the package code to bypass the request for global installation. However, I still had to use SUDO prefix to execute the CLI commands, which prompted me to learn about file system permission. After fixing that, I uninstalled everything and installed a fresh new node, but the zk command still existed. So let's say you have a package you want to delete for some reason, in my case, that will be zkapp-cli and I wanted to delete it entirely and install a new one because I messed up the configuration, normally the first thing one would do is to run npm uninstall or you can add sudo if you get a permission error just like I did. The above command should fix it in most cases, but there are scenarios where you'd have to add the global flag -g to delete it from the global scope, then you'll have to run npm uninstall -g Now let's check if it still exists on our global scope by checking the list of all installed packages by running the following command. As you can see, my list is empty cause I deleted everything trying to find out where this package was hiding

Mar 25, 2025 - 18:21
 0
How to fully uninstall a CLI package entirely from your Mac

I installed zkapp-cli on node 19 using NVM but ran into an EACCESS Permission error while deploying my test project. To fix it, I modified the package code to bypass the request for global installation. However, I still had to use SUDO prefix to execute the CLI commands, which prompted me to learn about file system permission. After fixing that, I uninstalled everything and installed a fresh new node, but the zk command still existed.

So let's say you have a package you want to delete for some reason, in my case, that will be zkapp-cli and I wanted to delete it entirely and install a new one because I messed up the configuration, normally the first thing one would do is to run npm uninstall or you can add sudo if you get a permission error just like I did.

Image description

The above command should fix it in most cases, but there are scenarios where you'd have to add the global flag -g to delete it from the global scope, then you'll have to run npm uninstall -g

Image description

Now let's check if it still exists on our global scope by checking the list of all installed packages by running the following command. As you can see, my list is empty cause I deleted everything trying to find out where this package was hiding