尝试最新稳定版 npm

查看正在运行的 npm 版本

npm -v

在 *nix 上升级(OSX、Linux 等)

(您可能需要在这些命令前加上 sudo,特别是在 Linux 或 OS X 上,如果您使用默认安装程序安装 Node。)

您可以使用以下命令升级到最新版本的 npm:

npm install -g npm@latest

在 Windows 上升级

默认情况下,npm 安装在 node 旁边

C:\Program Files (x86)\nodejs

npm 的全局安装包(可能包括 npm 本身)单独存储在用户特定的目录中(当前是

tX6MlX4WRkYPXSY/vHXHeTwRLJBjRhZJMj4o5ogoRXms4LwClaPsfZtQwOjKR4KyafBQ4kEjFtBAt3N6U97jzw==

sQPM+eE0qKmf5C/cHFrA1hfdiwV2PFFfXRNany57qIY=

dsec+xLl9IdHDOtVyt+KFFSMxqIgjpBRB5kWGA7lcEkW/L6GacOmsylSPthb1rIi

hhaKDbkCMNxwYuEjoPqvPg==

tX6MlX4WRkYPXSY/vHXHeTwRLJBjRhZJMj4o5ogoRXms4LwClaPsfZtQwOjKR4KyRNs8WCz7W6reNgv1LwwoGQ==

GlQQZrBXapEJPERyddEyT+9lLnsRaW5YF5I+ya0PFGuq5wkh1YVj+n8M8nj6jvY+oANZqaUIODKD7k8NOZ8+aDb29P8L6/p9IfE+6hN88LSPMOvdvdLLtU0GfbUp3pYgYOOWnai3dEy1j6OstNWPT46MuL/OkUcnggYwdREyqJpI9I/Blv8UJ4Lwa7+kaMfcIErdmL8ZtjCUbA5H2XzCJviW+7TQ9bRxI3C77a0mqD+2YwSBG4j6Cpl+NnqmL0hJ

jvvi11DrjMbAIfSfGzzNQRJyZHGPKAYqzKovBp3C9Z/EDx4QLzMbWccDwfMMgYqP5o9mxTIZy3Izbtr3xAYnYQ==

    obcIB8Ypn/zVbGPzJobj/jJyPy878gQlOEY8iZ2MJL6Q/UCbRlpt8ZT9olbtiYtlb2PAJj0MSgnnu6hhZhNv/Ylste9fSgqwBOiM9/fDP8oaBNZvrwTZMfMcnaYcfqpJYu1ycv16tx74+8LGqA5k9BfO4VaTTumlwPXOyohUO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xvEpKXoTifHDHV40Jdbn9Lj+O2hOr8zOdHUdwumn92zDl+EL4VLXQH+n+61LMRuHCbt05GeMatak8s6oKfDz92GspxXCyCeya8mOavq9hf6HRGHbwm36fAV6x529IFLWYXE0dUMKvSe5SO27HW5bM6BJ7511HDtlgDs2SDt