-
-
Notifications
You must be signed in to change notification settings - Fork 750
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
Feature suggestion: n uninstall #540
Comments
Proposed uninstall steps for default install to rm -f "/usr/local/bin/node"
rm -f "/usr/local/bin/npm"
rm -f "/usr/local/bin/npx"
rm -rf "/usr/local/include/node"
rm -rf "/usr/local/lib/dtrace/node.d"
rm -rf "/usr/local/lib/node_modules/npm"
rm -rf "/usr/local/share/doc/node"
rm -rf "/usr/local/share/man/man1/node.1"
rm -rf "/usr/local/share/systemtap/tapset/node.stp" |
How about |
@FranklinYu |
The typo was why I asked. Nevertheless, |
Added in v4.1.0 |
Suggestion
I propose
n uninstall
removes the active version of node and npm installed byn
. e.g. for default install location:I think this would be useful in various scenarios:
n
installed node and npm because trying another way of managing themHistory
This has come up multiple times. See #127 #169 PR #173 #238 #327 #441 #486
Three different things often get discussed or mixed together: uninstalling
n
, uninstalling the active version of node, and deleting the downloaded cached versions of node. I am suggestingn uninstall
only does the middle case as they are useful separate operations and there are already simple commands for doing the other two flavours:n
: e.g.npm uninstall -g n
n prune
(all but one) orrm -rf /usr/local/n
(all)On a related note, the third party installer n-install has
n-uninstall
which does all three uninstall cases at once.Other syntax considered, but I didn't like as much as uninstall:
n system
(Simple command to switch back to the system installation of Node #486 How to uninstall n? #169)n none
(PR Selectable None #173)Uninstall References and Implementation
Personally I initially didn't like the idea of implementing this because
n
installs using the nodejs distribution and does not use much specific knowledge of the layout. But it is a commonly requested feature, and it is a bit of a pain to delete manually. Two example links are:I propose the implementation should use fixed knowledge of the target locations rather than consult a particular cached version, not least because you are likely to have installed multiple versions over time, and may have deleted the cached version.
I propose the implementation only deletes the files and folders
n
may have installed, and not other related things like global npm and node modules. I think just undoing the things thatn
was used for is simpler and safer.The text was updated successfully, but these errors were encountered: