gpt4 book ai didi

node.js - 在 Node js 上安装必要的包时出错

转载 作者:行者123 更新时间:2023-12-04 01:03:52 25 4
gpt4 key购买 nike

我在 Windows 上安装 Node.js。它安装成功,我还选择了在 node.js 安装程序中安装必要文件(例​​如 Chocolatey)的选项。 node安装好后,打开Powershell;安装一段时间后,出现这个错误:

# A lot of logs before, just an excerpt
Microsoft.VisualStudio.Workload.VCTools Microsoft.VisualStudio.Component.Roslyn.Compiler Microsoft.Component.MSBuild Microsoft.VisualStudio.Component.CoreBuildTools Microsoft.VisualStudio.Component.Windows10SDK Microsoft.VisualStudio.Component.VC.CoreBuildTools Microsoft.VisualStudio.Component.Static.Analysis.Tools Microsoft.VisualStudio.Component.VC.Tools.x86.x64 Microsoft.VisualStudio.Component.VC.Redist.14.Latest Microsoft.VisualStudio.Component.Windows10SDK.17763 Microsoft.VisualStudio.Component.VC.CMake.Project Microsoft.VisualStudio.Component.TestTools.BuildTools
[5330:000f][2021-04-19T18:24:09] Decorating UnelevatedProductModifier with UnelevatedInstallerTelemetryDecorator
[5330:000f][2021-04-19T18:24:09] Created a UnelevatedInstallerTelemetryDecorator
[5330:000e][2021-04-19T18:24:09] Download requested: https://aka.ms/vs/15/release/channel
[5330:001d][2021-04-19T18:24:09] Attempting download 'https://aka.ms/vs/15/release/channel' using engine 'WebClient'
[5330:001d][2021-04-19T18:24:09] WebClient error 'RequestCanceled' with 'https://aka.ms/vs/15/release/channel' - GetWebResponse failed along with a cancellation request
[5330:001d][2021-04-19T18:24:09] Error 0x8013153b: [5330:001d][2021-04-19T18:24:09] Could not update channel "https://aka.ms/vs/15/release/channel"
at System.Threading.CancellationToken.ThrowOperationCanceledException()
at System.Threading.CancellationToken.ThrowIfCancellationRequested()
at Microsoft.VisualStudio.Setup.Download.WebClientEngine.GetWebResponse(Uri uri, DownloadContext downloadContext, DownloadSummary& downloadSummary, HttpWebRequest& webRequest, CancellationToken cancellationToken)
at Microsoft.VisualStudio.Setup.Download.WebClientEngine.DownloadCore(Uri uri, Stream stream, ProgressUpdateCallback progress, CancellationToken cancellationToken, DownloadContext downloadContext, ITelemetryOperation telemetryOperation)
at Microsoft.VisualStudio.Setup.Download.DownloadEngineBase.DownloadWithBitRate(Uri uri, Stream outputStream, ProgressUpdateCallback progress, CancellationToken cancellationToken, DownloadContext downloadContext, ITelemetryOperation telemetryOperation)
at Microsoft.VisualStudio.Setup.Download.DownloadEngineBase.Download(Uri uri, Stream outputStream, ProgressUpdateCallback progress, CancellationToken cancellationToken, DownloadContext downloadContext, ITelemetryOperation telemetryOperation)
at Microsoft.VisualStudio.Setup.Download.DownloadManager.DownloadWithRetry(IDownloadEngine[] engines, Uri uri, Stream outputStream, ProgressUpdateCallback progress, CancellationToken cancellationToken, DownloadContext downloadContext, Boolean verifySignature)
at Microsoft.VisualStudio.Setup.Download.DownloadManager.<>c__DisplayClass23_0.<Download>b__0()
at System.Threading.Tasks.Task`1.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.Setup.ChannelManager.<GetLatestChannelManifestAsync>d__85.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.Setup.ChannelManager.<UpdateChannelManifestAsync>d__77.MoveNext()
没有其他事情发生。我该怎么办?

最佳答案

今天同样的问题。在为 VS Code(不是 Visual Studio)安装 Node.JS 时,我只是让 Windows Powershell 停止并卡住了大约 5 分钟。控制台的最后输出是:
$ 创建了一个 UnelevatedInstallerTelemetryDecorator
长话短说:我不得不退出终端(不喜欢这个 Action )并重新启动计算机,因为安装程序仍在运行。然后我点击安装文件运行 Node.js 安装向导(node-v15.14.0-x64.msi)。有第二个选项可以修复安装尝试:“修复”。单击该按钮,安装向导会在完全退出的情况下完成修复。程序注意到某些元素尚未完成。然后你可以在 VS Code 的终端上运行一个 javascript 文件。
我不必修复 VS Code。
从 VS Code 终端运行的示例(终端条目以粗体显示)
PS“驱动器位置”\JavaScript> Node canDrinkNoIfs.js
要在 VSC 中运行脚本,我需要打开文件夹(文件 -> 打开文件夹。)然后创建一个 json 文件来运行和调试代码。此 json 文件保存在 .vscode 子文件夹中。

{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "pwa-node",
"request": "launch",
"name": "Launch Program",
"skipFiles": [
"<node_internals>/**"
],
"program": "${workspaceFolder}\\canDrinkNoifs.js"
}]}

关于node.js - 在 Node js 上安装必要的包时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67171333/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com