How do I remove old versions of node/npm?

后端 未结 2 570
萌比男神i
萌比男神i 2021-01-04 20:49

I\'ve been playing around with node a couple of months ago, as it\'s a fast evolving project, I thought I\'d need to update it when I picked it up recently, not knowing how

相关标签:
2条回答
  • 2021-01-04 20:53

    Could you give it a shot with this script from the npm site?

    It should clean up any old installations you have and install the latest version.

    0 讨论(0)
  • 2021-01-04 21:01

    To remove all cached versions except the current version

    sudo n prune
    

    Check how much all those versions are taking with du -sh /usr/local/n/versions.

    Also,

    Remove the installed node and npm (does not affect the cached version). This can be useful to revert to the system version of node (if in a different location), or if you no longer wish to use node and npm, or are switching to a different way of managing them.

    sudo n uninstall
    
    0 讨论(0)
提交回复
热议问题