本来是尝试在windows下用命令升级nodejs,结果发现浪费了挺大劲,升级的是npm,已经记录的差不多了,有不舍得删,特此另起一篇记录吧。
npm
为淘宝源,实在是等不起npm install -g cnpm --registry=https://registry.npm.taobao.org
npm-windows-upgrade
的包cnpm install npm-windows-upgrade
npm-windows-upgrade
npm-windows-upgrade
提示内容的大意是没有权限,请一管理员身份运行
powershell
(win+x按键)继续执行上述命令,提示如下内容
npm-windows-upgrade v6.0.1
Scripts cannot be executed on this system.
To fix, run the command below as Administrator in PowerShell and try again:
Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force
大意是解决方法在终端中执行如下命令
Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force
npm-windows-upgrade
显示内容如下
npm-windows-upgrade v6.0.1
? Which version do you want to install? (Use arrow keys)
> 6.9.0
6.9.0-next.0
6.8.0
6.8.0-next.2
6.8.0-next.1
6.8.0-next.0
6.7.0
(Move up and down to reveal more choices)
npm-windows-upgrade -p -v latest
参考:
https://stackoverflow.com/questions/18412129/how-can-i-update-npm-on-windows
https://npm.taobao.org/