Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I remove old versions of node/npm?

Tags:

node.js

npm

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 and having read about n, I installed that, installed the latest version.

Everything was OK until I tried to use npm, which wouldnt work, see this issue.

So I needed to remove n, I didn't know how so instead removed all the versions of node I had installed using n - {version} for each version I had.

I then ran the installer straight off the node.js website, hoping it would fix all the issues I'm having.

Node now works as expected, but npm is still not working.

The error that is shown in npm-debug.log when trying npm install {package} is :

ERR! Error: EISDIR, mkdir '/'
ERR! You may report this log at:
ERR!     <http://github.com/isaacs/npm/issues>
ERR! or email it to:
ERR!     <[email protected]>
ERR!
ERR! System Darwin 11.3.0
ERR! command "node" "/usr/local/bin/npm"
ERR! cwd /
ERR! node -v v0.6.15
ERR! npm -v 1.1.16
ERR! path /
ERR! code EISDIR
ERR! message EISDIR, mkdir '/'
ERR! errno {}

What I'm trying to do is re-install node + npm and start all over again.

I'm using a Mac, and have little experience with the commandline + file system in general with OS X, still trying to adjust from the Windows way.. (Control panel -> Uninstall -> ....).

Any help with this would be appreciated.

like image 834
Daniel Avatar asked Apr 28 '12 15:04

Daniel


People also ask

How do I uninstall a specific version of node?

Use NVM to Uninstall Node NVM allows you to uninstall Node versions that are no longer required. Run the command nvm uninstall with the version of Node you'd like to remove. You cannot remove a version you are currently using, so you must switch to a different version first.

How do I uninstall old node JS?

Search for Program and features. Under the program and features click on Uninstall a program. Now search for Node. js and uninstall it.

How do I force an npm package to uninstall?

To remove a package with the npm uninstall command, you can use the syntax npm uninstall package-name in the directory where the package is located.


1 Answers

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.

like image 91
mekwall Avatar answered Oct 18 '22 13:10

mekwall