如何删除旧版本的 node/npm? [英] How do I remove old versions of node/npm?

查看:197
本文介绍了如何删除旧版本的 node/npm?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

几个月前我一直在玩 node,因为它是一个快速发展的项目,我认为我最近拿起它时需要更新它,不知道如何并且已经阅读了 n,我安装了那个,安装了最新版本.

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.

一切正常,直到我尝试使用 npm,但它不起作用,请参阅 这个问题.

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

所以我需要删除 n,我不知道如何删除我使用 n - {version} 安装的所有节点版本.

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.

然后我直接从 node.js 网站运行安装程序,希望它能解决我遇到的所有问题.

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

Node 现在按预期工作,但 npm 仍然 不工作.

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

尝试 npm install {package}npm-debug.log 中显示的错误是:

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!     <npm-@googlegroups.com>
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 {}

我要做的是重新安装 node + npm 并重新开始.

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

我使用的是 Mac,并且对 OS X 的命令行 + 文件系统几乎没有经验,仍在尝试从 Windows 方式进行调整..(控制面板 -> 卸载 -> ....).

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.

推荐答案

你能试试 这个脚本 来自 npm 站点?

它应该清理您拥有的所有旧安装并安装最新版本.

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

这篇关于如何删除旧版本的 node/npm?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆