为什么我在不同的 windows 目录中有不同版本的 npm?

Why do I have different versions of npm in different windows directories?

我正在尝试启动一个 angular2 应用程序,它至少需要 npm 3.x.x,所以我加载了 cmd 并 运行:

>f:
>cd f:\code\angular2app
>npm -v
2.11.2

然后我运行

>c:
>cd c:\Users\my.name\AppData\Roaming\npm
>npm -v
3.9.5

是什么导致这两个目录的 npm 版本不同?
我怎样才能 运行 npm install npm -g 在 angular2app 目录中实际全局安装最新版本?

您似乎在这些目录中分别安装了两次 npm。删除两个本地版本,然后全局重新安装 npm。