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

前端 未结 28 2201
难免孤独
难免孤独 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条回答
  •  说谎
    说谎 (楼主)
    2020-11-21 06:09

    https://stackabuse.com/how-to-uninstall-node-js-from-mac-osx/

    Run following commands to remove node completely from system in MACOS

    sudo rm -rf ~/.npm ~/.nvm ~/node_modules ~/.node-gyp ~/.npmrc ~/.node_repl_history
    sudo rm -rf /usr/local/bin/npm /usr/local/bin/node-debug /usr/local/bin/node /usr/local/bin/node-gyp
    sudo rm -rf /usr/local/share/man/man1/node* /usr/local/share/man/man1/npm*
    sudo rm -rf /usr/local/include/node /usr/local/include/node_modules
    sudo rm -rf /usr/local/lib/node /usr/local/lib/node_modules /usr/local/lib/dtrace/node.d
    sudo rm -rf /opt/local/include/node /opt/local/bin/node /opt/local/lib/node
    sudo rm -rf /usr/local/share/doc/node
    sudo rm -rf /usr/local/share/systemtap/tapset/node.stp
    
    brew uninstall node
    brew doctor
    brew cleanup --prune-prefix
    



    After this i will suggest to use following command to install node using nvm

    curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash

    from https://github.com/nvm-sh/nvm

提交回复
热议问题