首先,以管理员身份运行PowerShell,单击“开始”,搜索PowerShell,右键单击PowerShell,选择“以管理员身份运行”。
Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force
npm install -g npm-windows-upgrade
npm-windows-upgrade
系统将提示您选择要安装的NPM版本。使用箭头键上下移动,选择要更新到的版本,然后按Enter键。
如果升级成功,您应该会看到类似这样的内容。