[英]unable to upgrade npm to newest version via windows cmd
Hello I am currently trying to grab the latest version of npm and I am trying to follow the directions from https://www.npmjs.com/package/npm-windows-upgrade in order to get the latest version, but when I get to the step 'npm install --global --production npm-windows-upgrade' it just hangs for hours and does nothing. 您好,我目前正在尝试获取npm的最新版本,并且尝试按照https://www.npmjs.com/package/npm-windows-upgrade的说明进行操作,以获得最新版本,但是当我得到到“ npm install --global --production npm-windows-upgrade”步骤,它挂了几个小时,什么也不做。
http://imgur.com/a/DWon8 http://imgur.com/a/DWon8
any help would be appreciated 任何帮助,将不胜感激
Just to make it clear, you're not having trouble running npm-windows-upgrade
to upgrade your npm version. 为了清楚npm-windows-upgrade
,您无需运行npm-windows-upgrade
即可升级npm版本。 You're having trouble installing the upgrade tool. 您在安装升级工具时遇到问题。
First, make sure you are running PS as an administrator . 首先,请确保您以管理员身份运行PS 。 If that doesn't help, you should probably look at the section fix-an-attempted-upgrade from their readme.md: 如果那没有帮助,您可能应该阅读他们的readme.md中的fix-an-attempted-upgrade部分:
Chances are that you attempted to upgrade npm before, it somehow failed, and you then went looking for this tool. 您可能之前曾尝试升级npm,但由于某种原因它失败了,然后您便开始寻找此工具。 If the tool fails to upgrade, it may be troubled by partial changes done during npm install npm
or npm upgrade npm
. 如果该工具无法升级,则可能会因npm install npm
或npm upgrade npm
期间所做的部分更改而感到困扰。 In that case, you will have to completely uninstall Node: 在这种情况下,您将必须完全卸载Node:
Uninstall
, not the Repair
option). 卸载Node.js(选择“ Uninstall
,而不是“ Repair
选项)。 %programfiles%\\nodejs
and delete the entire folder. 进入%programfiles%\\nodejs
并删除整个文件夹。 %appdata%\\npm
and %appdata%\\npm-cache
. 删除%appdata%\\npm
和%appdata%\\npm-cache
。 PATH
and remove everything that references npm (to do so, hit "Start" and search for "Environment Variables"). 编辑您的PATH
并删除所有引用npm的内容(为此,请单击“开始”并搜索“环境变量”)。 npm install npm
. 重新安装Node,然后安装此工具-仅使用此工具升级npm,请勿尝试运行npm install npm
。 PS : There's also a chance that you're running an NPM version that is too old be be compatible with installing npm-windows-upgrade
, but I'm saying that based on nothing. PS :还有一种可能是您正在运行的NPM版本过旧,无法与安装npm-windows-upgrade
兼容,但是我说的是毫无根据的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.