参考:https://chocolatey.org/docs/installation
管理员方式运行cmd,运行以下命令:
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
安装完成,运行以下代码测试:
choco list --local-only
显示类似这样的就成功了:
Chocolatey v0.10.15
chocolatey 0.10.15
1 packages installed.
choco具体命令参考:https://github.com/chocolatey/choco/wiki/CommandsList
choco list --local-only
choco list -li
choco list -lai
choco list --page=0 --page-size=25
choco search git
choco search git --source="'https://somewhere/out/there'"
choco search bob -s "'https://somewhere/protected'" -u user -p pass
参考:https://chocolatey.org/packages/nodejs
以管理员方式打开cmd窗口,运行:
choco install nodejs
更新node.js命令:
choco upgrade nodejs
打开新的cmd窗口,输入:
node -v
会显示nodejs的版本,说明安装成功!
其他package参考官方网站:https://chocolatey.org/packages