修复 Chocolatey“访问被拒绝”的问题

2024-02-23

我刚刚第一次使用安装了 Chocolateythis https://i.stack.imgur.com/fw9WX.png管理员 cmd 中的命令:

@“%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe” -NoProfile -InputFormat 无 -ExecutionPolicy 绕过 -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"

管理命令输出:

Getting latest version of the Chocolatey package for download.
Getting Chocolatey from https://chocolatey.org/api/v2/package/chocolatey/0.10.13.
Extracting C:\Users\CurrentUser\AppData\Local\Temp\chocolatey\chocInstall\chocolatey.zip to C:\Users\CurrentUser\AppData\Local\Temp\chocolatey\chocInstall...
Installing chocolatey on this machine
Creating ChocolateyInstall as an environment variable (targeting 'Machine')
  Setting ChocolateyInstall to 'C:\ProgramData\chocolatey'
WARNING: It's very likely you will need to close and reopen your shell
  before you can use choco.
Restricting write permissions to Administrators
We are setting up the Chocolatey package repository.
The packages themselves go to 'C:\ProgramData\chocolatey\lib'
  (i.e. C:\ProgramData\chocolatey\lib\yourPackageName).
A shim file for the command line goes to 'C:\ProgramData\chocolatey\bin'
  and points to an executable in 'C:\ProgramData\chocolatey\lib\yourPackageName'.

Creating Chocolatey folders if they do not already exist.

WARNING: You can safely ignore errors related to missing log files when
  upgrading from a version of Chocolatey less than 0.9.9.
  'Batch file could not be found' is also safe to ignore.
  'The system cannot find the file specified' - also safe.
WARNING: Not setting tab completion: Profile file does not exist at
'C:\Users\CurrentUser\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1'.
WARNING: Unable to run Chocolately at this time.  It is likely that .Net Framework installation requires a system reboot
Chocolatey (choco.exe) is now ready.
You can call choco from anywhere, command line or powershell by typing choco.
Run choco /? for a list of functions.
You may need to shut down and restart powershell and/or consoles
 first prior to using choco.
Ensuring chocolatey commands are on the path
Ensuring chocolatey.nupkg is in the lib folder

重新启动 cmd 后,我仍然无法访问 choco 命令:

似乎没有文件说明为什么会发生这种情况。如何解决这个问题?


以管理员身份运行命令提示符,然后运行命令“choco install nodejs”

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

修复 Chocolatey“访问被拒绝”的问题 的相关文章

随机推荐

  • 从 Qt 5.7 切换到 Qt 5.8 - “代理类型对此操作无效”

    我正在尝试使用 Qt 5 8 重新编译一个与 Qt 5 7 配合良好的网络应用程序 然而 使用Qt 5 8 服务器无法listen int myPort 52000 some accessible port QTcpServer serve
  • 在使用 linq-to-entities 的一对多连接中仅获取一条(最后一条)记录

    我在 linq to entities 中有以下内容 clientprojects from p in this SAPMappingEntities SAP Master Projects join c in this SAPMappin
  • 在 GitHub Actions 中缓存 node_modules

    我有一个 Yarn monorepo 工作区 有 2 个包 后端 Node js TypeScript 和前端 React Typescript package json 已修剪 workspaces backend frontend 我正
  • Xamarin.IOS 上的内存管理如何工作

    我正在尝试了解使用 xamarin ios 并在实际 iOS 设备上运行该应用程序时内存管理的工作原理 我的理解是iOS平台没有垃圾收集器 但是平台使用ARC Automatci Reference Counting 编译后的应用程序真的会
  • Powershell 在 System.Drawing 中使用 .NET .DrawImage

    我正在制作一个工具 可以自动裁剪和定位 无需将图像大小调整为其他图像 我发现this https learn microsoft com en us dotnet api system drawing graphics drawimageu
  • 我正在评估 Google Pub/Sub 与 Kafka。有什么区别? [关闭]

    Closed 这个问题需要多问focused help closed questions 目前不接受答案 我对kafka的工作不多 但想在GCE中构建数据管道 所以我们想了解 Kafka 与 PUB Sub 基本上我想知道Kafka和Pub
  • 转换为 Func 与新 Func?

    下面两条语句有什么区别吗 他们都工作 if Func
  • 如何在 C# 中为控件添加移动效果?

    我的 C 表单中有一个面板 并且有一个按钮 当我单击按钮时 会显示不可见的面板 相反 我希望面板移入或滑入 例如 当您单击组合框时 下拉列表不会弹出 我希望我的面板像那样显示 我怎样才能做到这一点 窗口动画是 Windows 的内置功能 这
  • 无法传入 lambda 来申请 pandas DataFrame

    我正在尝试将函数应用于 pandas DataFrame 的所有行 实际上只是该 DataFrame 中的一列 我确信这是一个语法错误 但我知道我做错了什么 df col apply lambda x y x y total seconds
  • CLR 项目的智能感知 - 例如没有智能感知系统.Windows.窗体

    我一直在关注一些关于某些内容的两个教程Visual C 基础知识 http www functionx com vccli general introprogramming htm但他们似乎都缺乏有关我如何在 Visual Studio 2
  • Google AppInvites 中断构建

    您的应用程序的一部分build gradle这是 tasks withType com android build gradle tasks PackageApplication pkgTask gt pkgTask jniFolders
  • 如何在v-html中运行脚本

    我从数据库获取嵌入代码 Instagram Twitter 等 如何将它们绑定到 vue 组件 有没有办法在v html中执行脚本标签 简短的回答 你不能 一旦 dom 加载 您的浏览器就会阻止脚本标签的执行 长答案 您可以尝试匹配脚本的
  • 如何保留对 NPM 模块所做的本地更改?

    我已经使用 NPM 拉下了一个节点模块 并将其添加到package json 然而 需要更改模块的一些代码 因为它没有 100 满足我的要求 通常当我使用节点时git我会忽略node modules目录及使用npm install部署到服务
  • CSS - 并排的内联块,宽度为 100%

    我有两个带有文本的块 文本的长度不是恒定的 用户输入 左侧块中包含短文本 但右侧块可能包含非常长的文本 这些块应该并排出现 并且分布在父级恒定宽度的 100 上 不多也不少 简化示例 https jsfiddle net hh6a03cy
  • 在恒定空间和线性时间内向后打印单链表

    我听到一个面试问题 向后打印单链表 在恒定空间和线性时间中 我的解决方案是反转链接列表 然后像这样打印它 还有其他非破坏性的解决方案吗 您已经找到了大部分答案 将链表反转到位 然后将列表遍历回开头以打印它 为了防止它 永久 破坏性 请就地反
  • AtomicBoolean 与同步块

    我试图通过替换一些来减少代码中的线程争用synchronized块与AtomicBoolean 这是一个例子synchronized public void toggleCondition synchronized this mutex i
  • Subversion 和 CVS 中添加自动内容的标签怎么称呼?

    像 log and version 在签入文件时添加数据 我有兴趣查看其他人以及他们可以提供哪些信息 但除非我知道他们叫什么 否则我无法获得太多信息 Subversion 和 CVS 都称它们为Keywords 在这里查看 SVN 手册 h
  • 窗口函数过滤当前行

    这是后续this https stackoverflow com questions 48000013 optimize slow aggregates in lateral join问题 我的查询被改进为使用窗口函数而不是内部的聚合LAT
  • 你如何制作一个makefile

    我想知道如何为 Unix 创建 makefile 这里有一个好的生成文件教程 http oucsace cs ohiou edu bhumphre makefile html 搜索 如何创建 makefile 后 Google 上的第一个结
  • 修复 Chocolatey“访问被拒绝”的问题

    我刚刚第一次使用安装了 Chocolateythis https i stack imgur com fw9WX png管理员 cmd 中的命令 SystemRoot System32 WindowsPowerShell v1 0 powe