How do I completely uninstall Node.js, and reinstall from beginning (Mac OS X)

前端 未结 28 2312
难免孤独
难免孤独 2020-11-21 05:28

My version of node is always v0.6.1-pre even after I install brew node and NVM install v0.6.19.

My node version is:



        
28条回答
  •  闹比i
    闹比i (楼主)
    2020-11-21 06:10

    As a companion to the answers explaining cleanup and install via homebrew, I found that homebrew itself provided clear indications of the symlink clashes.

    Unfortunately it provides these one by one as it encounters them, so it is a little laborious, but it does seem to find all the clashes and was the only way I could get a clean install with homebrew.

    Essentially, the process is:

    1. use homebrew to uninstall node
    2. clean homebrew
    3. use homebrew to install node and note any flagged clashing file
    4. delete the flag clashing file (or whole directory if it is a 'node' directory)
    5. goto step 1 until you get a clean install

    :

    Here is a screen output from the last steps of my install - you can see it results in a clean install (eventually...):

    computer1:DevResources user1$ brew install node
    Updating Homebrew...
    ==> Downloading https://homebrew.bintray.com/bottles/node-13.1.0.mojave.bottle.tar.gz
    Already downloaded: /Users/user1/Library/Caches/Homebrew/downloads/da904f1fdab6f6b2243a810b685e67b29a642c6e945f086e0022323a37fe85f9--node-13.1.0.mojave.bottle.tar.gz
    ==> Pouring node-13.1.0.mojave.bottle.tar.gz
    Error: The `brew link` step did not complete successfully
    The formula built, but is not symlinked into /usr/local
    Could not symlink share/systemtap/tapset/node.stp
    Target /usr/local/share/systemtap/tapset/node.stp
    already exists. You may want to remove it:
      rm '/usr/local/share/systemtap/tapset/node.stp'
    
    To force the link and overwrite all conflicting files:
      brew link --overwrite node
    
    To list all files that would be deleted:
      brew link --overwrite --dry-run node
    
    Possible conflicting files are:
    /usr/local/share/systemtap/tapset/node.stp
    /usr/local/lib/dtrace/node.d
    ==> Caveats
    Bash completion has been installed to:
      /usr/local/etc/bash_completion.d
    ==> Summary
    

提交回复
热议问题