简体   繁体   English

无法通过Windows cmd将npm升级到最新版本

[英]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部分:

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 npmnpm upgrade npm期间所做的部分更改而感到困扰。 In that case, you will have to completely uninstall Node: 在这种情况下,您将必须完全卸载Node:

  • Uninstall Node.js (select Uninstall , not the Repair option). 卸载Node.js(选择“ Uninstall ,而不是“ Repair选项)。
  • Go into %programfiles%\\nodejs and delete the entire folder. 进入%programfiles%\\nodejs并删除整个文件夹。
  • Delete %appdata%\\npm and %appdata%\\npm-cache . 删除%appdata%\\npm%appdata%\\npm-cache
  • Edit your PATH and remove everything that references npm (to do so, hit "Start" and search for "Environment Variables"). 编辑您的PATH并删除所有引用npm的内容(为此,请单击“开始”并搜索“环境变量”)。
  • Reinstall Node, then install this tool - and only use this tool to upgrade npm, do not attempt to run 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.

相关问题 NPM 插入符号不会引入最新的次要版本 - NPM caret doesn't bring in newest minor version 节点升级后,Npm install在Windows中不起作用 - Npm install not working in windows after node upgrade 使用npm Windows升级时的问题 - Issue when using npm Windows Upgrade 在Windows中使用HTML通过cmd文件下载 - FIle download via cmd in windows using HTML 无法升级依赖大版本如何修复npm中的漏洞? - How to fix the vulnerabilities in npm if I cannot upgrade the major version of dependency? windows 寻找工具版本上的节点 npm 错误 - Node npm error on windows looking for tools version 请问有人知道如何将现有项目从 Sencha Ext JS 4.2 升级到最新的 Sencha Ext JS 版本吗? - Does anyone know how to upgrade existing project from Sencha Ext JS 4.2 to newest Sencha Ext JS version please? npm WARN不推荐使用boom@2.10.1:此版本不再维护。 请升级到最新版本 - npm WARN deprecated boom@2.10.1: This version is no longer maintained. Please upgrade to the latest version 无法从旧的jscalendar彻底升级到新的jscal2版本 - Unable to cleanly upgrade from old jscalendar to new jscal2 version 将javascript更新到最新版本的JQuery - Update javascript to newest version of JQuery
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM