加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
install.ps1 738 Bytes
一键复制 编辑 原始数据 按行查看 历史
transcai 提交于 2022-08-11 17:24 . v1.0.0
$url = "https://npmmirror.com/mirrors/node/v14.18.3/node-v14.18.3-win-x64.zip"
$splits = ($url -split "/" )
$filename = $splits[$splits.Length - 1]
$subpath = ($filename -split ".zip")[0]
$curdir = Split-Path -Parent $MyInvocation.MyCommand.Definition
$zipfile = $curdir + '\' + $filename
if (Test-Path $zipfile) {
Remove-Item $zipfile
}
Write-Output "$url start downloading"
$client = new-object System.Net.WebClient
$client.DownloadFile($url, $zipfile)
$nodepath = $curdir + "\" + $subpath
Write-Output $nodepath
if (Test-Path $nodepath) {
Remove-Item -r $nodepath
}
Expand-Archive $filename -DestinationPath .\
$env:path += ";" + $nodepath
Write-Output "nodejs installed at $nodepath"
npm i
node install.js
npm run start
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化