-
-
Notifications
You must be signed in to change notification settings - Fork 745
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to uninstall n? #169
Comments
in |
Yes, but The point is that no cleanup is done before switch to new version of node binary. |
Oh, those files may be transferred there in once incorrect installation, just removed them and run |
$ cd /usr/local/bin/n && sudo make uninstall or just $ sudo rm -rf /usr/local/bin/n |
@sonewman the script will only removes Or, the problem should be how to remove the node installed by |
hmm, so you mean to set it back to the state that it was in before, i.e. the version of node originally installed? because to remove the node binary would be as simple as |
See |
Error: cannot remove currently active version (node/6.2.2) |
@bennybennet, are you trying to remove |
tried to remove n but wanted to remove all node versions before. |
@bennybennet, you should just be able to |
I know this is an older issue, but I thought it worth commenting: If you installed via the method mentioned in the docs,
then all you have to do is invoke I had forgotten I used this method to install |
At this writing I find the uninstall script at |
That's not official. Basically, if I run sudo apt-get install nodejs
sudo npm i -g n
sudo n 8 then, I simply want to go back to the state I had before as if I had ran only sudo apt-get install nodejs . So, if I intuitively try to do that like this: sudo apt-get install nodejs
sudo npm i -g n
sudo n 8 # it installed 8.9.4
sudo n rm 8.9.4
Error: cannot remove currently active version (node/8.9.4) So (officially) we're stuck. Then, eventually, we might find something (unofficial) like Furthermore, I didn't install This should just be built into |
Seriously, this sort of thing is annoying. It's like forgetting to write destructors and leaking memory in C++ classes. (no offense, I'm just annoyed that I have to go do it all manually, which negates the utility of the tool that I was hoping would save me time). I know the solution might be easy (perhaps something like what @qw3rtman suggested above), but the thing is, it takes time to figure out what the solution is, even if it's a one-liner. Good package managers (which |
why not have "system" as a choice for nodes within n? |
I came to a thread hoping to find the solution: Does anyone know the correct way? |
To be sure how to remove n we would need to know: How did you install And some answers for the most common situations:
sudo npm install --global n then you uninstall it using sudo npm uninstall --global n
sudo rm -rf /usr/local/n
To see if N_PREFIX is set you can run: echo "N_PREFIX is: ${N_PREFIX}" |
I have opened a new issue #540 with some research and ideas about what we might do in future. Subscribe to that issue for updates and/or give it a 👍 Thank you for your contributions. |
|
I'm trying to uninstall If I try
If I try
If I try
And I didn't find What am I doing wrong? |
Do you remember how you installed n? (Using npm? Using n-install? Using brew?) What does this show?
|
I'm using Windows 10 Linux Subsystem (if that matters),
Node: 10.16.0 |
(Edited after realising why install location different than I expected.) The three things to delete are the n package, the n command (usually a link into the package), and the cache folder. Not sure why npm is not listing n but no matter, some more questions so I can hopefully give you some accurate instructions. What do these show:
|
ls -l /usr/bin/n ls -d /usr/local/n echo $N_PREFIX Thank you for help! |
Ok, manual cleanup for your setup, all that is left is the cache:
|
I did that, but |
I'm wondering how to clean up my
/usr/local
directory after usen
to switch between versions?The text was updated successfully, but these errors were encountered: