Upgrading npm on Windows requires manual steps to ensure that PowerShell/CMD find the new version of npm. This is a small tool made with
First, ensure that you can execute scripts on your system by running the following command from an elevated PowerShell. To run PowerShell as Administrator, click Start, search for PowerShell, right-click PowerShell and select Run as Administrator
.
Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force
Then, to install and use this upgrader tool, run the following command (also from an elevated PowerShell or cmd.exe). Note: This tool requires at least Node v8, please install an older version for older versions of Node.js.
npm install --global --production npm-windows-upgrade
npm-windows-upgrade
Want to just install the latest version? Sure:
npm-windows-upgrade --npm-version latest
The tool will show you a list of all the published and available versions of npm (including pre-release and beta versions). Choose the one you want to install and let it do its thing!
Usage: npm-windows-upgrade [options]
Options:
-h, --help Output usage information
-V, --version Output the version number
-d, --no-dns-check Disable the internet connectivity test
-e, --no-execution-policy-check Disable the PowerShell execution policy test
-p, --no-spinner Disable the spinner animation
-n, --npm-path <path> (Optional) If passed, npm will be upgraded in the specified location
-v, --npm-version <version> (Optional) If passed, npm will be upgraded/downgraded to the specified version
If you have trouble with the script, consider adding parameters manually. A common issue is that the script fails to find npm (and therefore doesn't know where to install it) - in that case, pass the location manually.
npm-windows-upgrade --npm-path "C:\nodejs"
To manually specify a version to install, pass the version
parameter:
npm-windows-upgrade --npm-version 5.5.0
To override the internet connection check, pass --no-dns-check
. To disable the initial prompt, pass --no-prompt
.
To see debug output, set a DEBUG
environment variable ($env:DEBUG="npm-windows-upgrade"
)
Please do report your issues on GitHub. There are a bunch of Windows versions, hundreds of different ways to install Node and npm, and it's likely that this script won't work with a few of them. If you run into trouble and need npm upgraded as soon as possible, please follow the manual instructions.
This tool was made with
LICENSE
file.
Chances are that you attempted to upgrade npm before, it somehow failed, and you then went looking for this tool. If the tool fails to upgrade, it may be troubled by partial changes done during npm install npm
or npm upgrade npm
. In that case, you will have to completely uninstall Node:
Uninstall
, not the Repair
option).%programfiles%\nodejs
and delete the entire folder.%appdata%\npm
and %appdata%\npm-cache
.PATH
and remove everything that references npm (to do so, hit "Start" and search for "Environment Variables").npm install npm
.:memp: Used Chocolatey?If you used Chocolatey (https://chocolatey.org/) to install Node.js, be sure to check if npm is removed from the
choco\bin
directory by running the following command:where.exe npm
. Should it still be there, you will need to eitherchoco uninstall npm
or delete the files from this bin directory.
npm-windows-upgrade@5.0.0
npm-windows-upgrade@4.1.1
npm-windows-upgrade@3.1.1
Microsoft is working hard to make sure that our users have the best possible experience with Node.js. For a helpful set of content that makes it easier to avoid any potential gotchas, go check out our Node.js Guidelines - a collection of tips and advanced best practices!
Contributions are extremely welcome! For JavaScript code, please run grunt test
to check your code against JSCS and JSHint. There's no formal coding guideline for the PowerShell pieces of this tool, but do write code that is commented and comprehensible.
MIT, please see LICENSE
for details. Copyright (c) 2015 - 2017 Felix Rieseberg.
Windows 下npm升级方法 本来是尝试在windows下用命令升级nodejs,结果发现浪费了挺大劲,升级的是npm,已经记录的差不多了,有不舍得删,特此另起一篇记录吧。 1. 首先更新npm为淘宝源,实在是等不起 npm install -g cnpm --registry=https://registry.npm.taobao.org 2. 安装一个叫npm-windows-upgra
Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force npm install -g npm-windows-upgrade npm-windows-upgrade 转载于:https://www.cnblogs.com/zqunor/p/8231887.html
npm WARN deprecated node-pre-gyp@0.16.0: Please upgrade to @mapbox/node-pre-gyp: the non-scoped node-pre-gyp package is deprecated and only the @mapbox scoped package will recieve updates in the futur
如何升级nodejs版本 首先安装n模块, 输入npm install -g n n模块专门用来管理nodejs的版本。 如果出现npm ERR! notsup Unsupported platform for n@2.1.8: wanted {"os":"!win32","arch":"any"} (current: {"os":"win32","arch":"x64"}) 这样错误信息,在命令
安装VUE CLI时部分报错处理 报错代码如下 : C:\Windows\system32> npm install -g @vue/cli npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142 npm WARN depr
以管理员身份打开 PowerShell 执行以下命令 Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force npm install -g npm-windows-upgrade npm-windows-upgrade 转载于:https://my.oschina.net/u/3117745/blog/909401
npm-upgrade Interactive CLI utility to easily update outdated NPM dependencies with changelogs inspection support. What is this for? If you are tired of manually upgrading package.json every time your
Upgrades packages to their latest version based on the specified range. yarn upgrade [package | package@tag | package@version | @scope/]... [--ignore-engines] [--pattern] This command updates dependen
5. 升级到 seata 1.4.0 有哪些兼容性事项是需要注意的? 4. 升级到 seata 1.3.0 有哪些兼容性事项是需要注意的? 3. 升级到 seata 1.2.0 有哪些兼容性事项是需要注意的? 2. 升级到 seata 1.1.0 有哪些兼容性事项是需要注意的? 1. 0.8、0.9版本如何升级到1.0版本? 5. 升级到 seata 1.4.0 有哪些兼容性事项是需要注意的? 注
opkg-upgrade List and install OpenWRT / LEDE opkg upgradable packages. Little ash app for easier opkg package upgrades. You should check for config conflicts after upgrades! Make sure you have enough
Upgrade Framework 是一个与产品无关的,用于定义和升级的框架。 该框架包含四个项目: upgrade-framework-core 包含构造,以描述执行一组表示为Task对象的动作的过程,以将一个或多个持久性机制(由PersistenceContext封装在总体中的对象描述)UpgradeContext从一个过渡Version到另一个Version。 upgrade-framewo
This is similar to npm-check interactive update mode. It provides an easy way to update outdated packages. yarn upgrade-interactive [--latest] The upgrade-interactive command takes the same parameters