scoop就不介绍了 类似centos的yum,nodejs的npm 就是windows的包管理工具。

网上查了下安装方法PowerShell上执行

iex (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh')

直接执行 报错,具体报错信息找不到了 大概意思就是解析不到raw.githubusercontent.com

修改hosts文件添加

151.101.64.133 raw.githubusercontent.com

重新执行 又报错大意是DownloadFile时发生异常 应该是下载文件的问题 直接访问https://get.scoop.sh看shell里面执行了什么

发现 直接重定向了https://raw.githubusercontent.com/lukesampson/scoop/master/bin/install.ps1

所以第一步先给执行命令修改为

iex (New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/lukesampson/scoop/master/bin/install.ps1')

完美 出现

Initializing...

Downloading scoop...

等了大概两分钟 又提示我DownloadFile时异常

重新执行会提示

Scoop is already installed.

网上查了下 要删掉scoop的文件夹才能重新安装 去用户目录删掉scoop

一般都在c:\\用户\你的名字\scoop

删掉文件夹重新执行发现在Downloading scoop...的时候scoop\apps\scoop\current目录里面会下载一个文件scoop.zip但是没下载完就报错了。

问题找到就是scoop.zip这个文件没下载下来

查看https://raw.githubusercontent.com/lukesampson/scoop/master/bin/install.ps1这个shell

发现Downloading scoop...后面的脚本很简单就是下载个zip然后解压

$zipurl = 'https://github.com/ScoopInstaller/Scoop/archive/master.zip'
$zipfile = "$dir\scoop.zip"
Write-Output 'Downloading scoop...'
dl $zipurl $zipfile

浏览器直接下载这个zip包https://github.com/ScoopInstaller/Scoop/archive/master.zip

然后放到c:\\用户\你的名字\scoop\apps\scoop\current 里面 名字改成scoop.zip

把https://raw.githubusercontent.com/lukesampson/scoop/master/bin/install.ps1

这个脚本下载下来放到c:\\用户\你的名字\install.ps1

把检测scoop是否安装的脚本注释上

再把下载zip的脚本注释上

检测scoop目录是否存在的脚本

# prep
if (installed 'scoop') {write-host "Scoop is already installed. Run 'scoop update' to get the latest version." -f red# don't abort if invoked with iex that would close the PS sessionif ($myinvocation.mycommand.commandtype -eq 'Script') { return } else { exit 1 }
}

下载zip包的脚本

# download main bucket
$dir = "$scoopdir\buckets\main"
$zipurl = 'https://github.com/ScoopInstaller/Main/archive/master.zip'
$zipfile = "$dir\main-bucket.zip"
Write-Output 'Downloading main bucket...'
New-Item $dir -Type Directory -Force | Out-Null
dl $zipurl $zipfile

行首用# 注释

修改后的文件

#Requires -Version 5# remote install:
#   Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh')
$old_erroractionpreference = $erroractionpreference
$erroractionpreference = 'stop' # quit if anything goes wrongif (($PSVersionTable.PSVersion.Major) -lt 5) {Write-Output "PowerShell 5 or later is required to run Scoop."Write-Output "Upgrade PowerShell: https://docs.microsoft.com/en-us/powershell/scripting/setup/installing-windows-powershell"break
}# show notification to change execution policy:
$allowedExecutionPolicy = @('Unrestricted', 'RemoteSigned', 'ByPass')
if ((Get-ExecutionPolicy).ToString() -notin $allowedExecutionPolicy) {Write-Output "PowerShell requires an execution policy in [$($allowedExecutionPolicy -join ", ")] to run Scoop."Write-Output "For example, to set the execution policy to 'RemoteSigned' please run :"Write-Output "'Set-ExecutionPolicy RemoteSigned -scope CurrentUser'"break
}if ([System.Enum]::GetNames([System.Net.SecurityProtocolType]) -notcontains 'Tls12') {Write-Output "Scoop requires at least .NET Framework 4.5"Write-Output "Please download and install it first:"Write-Output "https://www.microsoft.com/net/download"break
}# get core functions
$core_url = 'https://raw.githubusercontent.com/ScoopInstaller/Scoop/master/lib/core.ps1'
Write-Output 'Initializing...'
Invoke-Expression (new-object net.webclient).downloadstring($core_url)# prep
# if (installed 'scoop') {
#     write-host "Scoop is already installed. Run 'scoop update' to get the latest version." -f red
#     # don't abort if invoked with iex that would close the PS session
#     if ($myinvocation.mycommand.commandtype -eq 'Script') { return } else { exit 1 }
# }
$dir = ensure (versiondir 'scoop' 'current')# download scoop zip
$zipurl = 'https://github.com/ScoopInstaller/Scoop/archive/master.zip'
$zipfile = "$dir\scoop.zip"
Write-Output 'Downloading scoop...'
# dl $zipurl $zipfileWrite-Output 'Extracting...'
Add-Type -Assembly "System.IO.Compression.FileSystem"
[IO.Compression.ZipFile]::ExtractToDirectory($zipfile, "$dir\_tmp")
Copy-Item "$dir\_tmp\*master\*" $dir -Recurse -Force
Remove-Item "$dir\_tmp", $zipfile -Recurse -ForceWrite-Output 'Creating shim...'
shim "$dir\bin\scoop.ps1" $false# download main bucket
$dir = "$scoopdir\buckets\main"
$zipurl = 'https://github.com/ScoopInstaller/Main/archive/master.zip'
$zipfile = "$dir\main-bucket.zip"
Write-Output 'Downloading main bucket...'
New-Item $dir -Type Directory -Force | Out-Null
dl $zipurl $zipfileWrite-Output 'Extracting...'
[IO.Compression.ZipFile]::ExtractToDirectory($zipfile, "$dir\_tmp")
Copy-Item "$dir\_tmp\*-master\*" $dir -Recurse -Force
Remove-Item "$dir\_tmp", $zipfile -Recurse -Forceensure_robocopy_in_path
ensure_scoop_in_pathscoop config lastupdate ([System.DateTime]::Now.ToString('o'))
success 'Scoop was installed successfully!'Write-Output "Type 'scoop help' for instructions."$erroractionpreference = $old_erroractionpreference # Reset $erroractionpreference to original value

修改完执行iex ./install.ps1

Scoop was installed successfully!

完美

执行scoop 可以正常运行

后面还有个下载文件 不知道为什么我就直接下载下来了没需要浏览器重新下载。

如果后面的报错用相同方法

遇事莫慌!

windows 安装scoop踩坑之旅相关推荐

  1. windows安装paddlepaddle踩坑教程

    问题:在windows的anaconda环境中安装paddlepaddle时,创建新的conda环境错误. 环境:Windows10+anaconda3.6.5+cuda10.1 解决方法:不要按照官 ...

  2. 重装win10系统+Ubuntu16.04的踩坑之旅(联想拯救者r720)

    重装win10系统+Ubuntu16.04的踩坑之旅(联想拯救者r720) 碎碎念:原本双系统用得很开心的,在手贱删了Ubuntu系统的某些隐藏文件之后导致Ubuntu系统不能正常使用,在某种程度强迫 ...

  3. python 同花顺thstrader_Python 踩坑之旅进程篇其三pgid是个什么鬼 (子进程\子孙进程无法kill 退出的解法)...

    代码示例支持 平台: Centos 6.3 Python: 2.7.14 1.1 踩坑案例 pid, ppid是大家比较常见的术语, 代表进程号,父进程号. 但pgid是个什么鬼? 了解pgid之前, ...

  4. 戴尔灵越7590 i7版安装manjaro踩坑及部分驱动问题解决

    文章目录 前言 一.Manjaro是什么 二.安装步骤 1.下载镜像 2.将Manjaro系统安装至实体机 将Manjaro镜像刻录至U盘并为Manjaro划分空间 更改bios选项 重启进入Manj ...

  5. Manjaro 安装配置踩坑

    Manjaro 安装配置踩坑 其实manjaro和arch的英文社区上都讲的很清楚, 推荐看英文原版资料. 制作USB安装器 参考资料 : Manjaro 官方User Guide 官网下载镜像 Li ...

  6. Vue踩坑之旅(一)—— 数组、对象的监听

    作为一个接触 vue 才一个多月的小白,马上就接手基于 vue 的大型商城项目,其间真是跌跌撞撞踩了好多坑(o(╥﹏╥)o).在此写下自己的踩坑之旅,希望给跟我一样还在自学 vue 的同学一些帮助,另 ...

  7. cmd命令安装composer踩坑

    cmd命令安装composer踩坑 很多童鞋在依照composer官网 官网教程 用命令行安装composer时回踩到以下坑,却不知道如何解决 在此我分享下自己的经验,写个不好请多海涵 打开命令行执行 ...

  8. GPCC安装以及踩坑经历

    gpcc安装以及踩坑经历 官方下载地址文档 https://network.pivotal.io/products/pivotal-gpdb#/releases/29190 安装开始之前 chown ...

  9. ubuntu 20.04 安装软件踩坑

    ubuntu 20.04 安装软件踩坑 1.搜狗输入法 安装后需要重启一次 重启后讲sogoupinyin添加好,右上角如果没有搜狗就再重启一下 右上角出现了搜狗也是打不出中文的,因为没有安装依赖 安 ...

最新文章

  1. 稳压管,TVS管,压敏电阻,气体放电管等电涌保护器器件比较------amoBBS
  2. jquery如何调用后台的方法
  3. (4)javascript的运算符以及运算符的优先级
  4. 长沙理工大学计算机网络试题,长沙理工大学考试试卷(计算机网络)要点.docx
  5. 20135316王剑桥 linux第六周课实验笔记
  6. oracle常见等待事件,必看干货 | Oracle 常见的等待事件说明(下)
  7. sudo修改文件夹名字_用 Python 高效智能管理文件夹
  8. cef 加载flash 弹框_cef 3.2357之后加载flash的方法
  9. 强烈推荐《全景探秘游戏设计艺术》
  10. 东芝 rc100 linux,东芝RC100 M.2 NVMe固态硬盘HMB特性解读
  11. Vue 集成 PDF.js 实现 PDF 预览和添加水印
  12. 如何设置代理服务器?
  13. lookup无序查找_excel无序查询 使用LOOKUP函数实现无序查询
  14. EasyExcel导出设置表头字体样式和批注
  15. [热键冲突]:Win10 输入法表情快捷键(Ctrl+Shift+B)如何关闭
  16. TypeScript-基础类型学习
  17. 迭代开发中的微服务拆分
  18. INE上线BiKi,开启“充值领空投+最少买入,也拿万元锦鲤”活动
  19. 计算机常用删除文件的5种方法,电脑清理C盘垃圾文件的几种方法
  20. 交换机hybrid模式

热门文章

  1. Fastapi 中间件 middleware
  2. struts----ActionForm Bean作用
  3. 企业数据备份方案-MxsDoc的自动备份的应用
  4. 移动web-空间转换
  5. VUE ----父子组件通信
  6. 八股文(MySQL数据库篇)
  7. 婴儿EEG数据的多元模式分析(MVPA):一个实用教程
  8. 埃森哲:领军企业盈利能力年同比增长速度至少是其他企业的六倍
  9. 事件冒泡、事件捕获、http与https
  10. html table的边框线怎么变圆角_CSS偶有所得 - table 边框加圆角踩坑