Node.js 在节点js上安装必要的包时出错

Node.js 在节点js上安装必要的包时出错,node.js,visual-studio,powershell,installation,Node.js,Visual Studio,Powershell,Installation,我正在Windows上安装Node.js。它安装成功,我还选择了在node.js安装程序中安装必要文件(如chocolate)的选项。节点安装后,打开Powershell;安装一段时间后,我遇到了以下错误: # A lot of logs before, just an excerpt Microsoft.VisualStudio.Workload.VCTools Microsoft.VisualStudio.Component.Roslyn.Compiler Microsoft.Compon

我正在Windows上安装Node.js。它安装成功,我还选择了在node.js安装程序中安装必要文件(如chocolate)的选项。节点安装后,打开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()
#以前有很多日志,只是一段摘录
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.ToolsMicrosoft.VisualStudio.Component.VC.Tools.x86.x64 Microsoft.VisualStudio.Component.VC.Redist.14.最新的Microsoft.VisualStudio.Component.Windows10SDK.17763 Microsoft.VisualStudio.Component.VC.CMake.Project Microsoft.VisualStudio.Component.TestTools.BuildTools
[5330:000f][2021-04-19T18:24:09]用未提升的InstallerTelemetryCorator装饰未提升的ProductModifier
[5330:000f][2021-04-19T18:24:09]创建了一个未提升的InstallerTeleMetryCorator
[5330:000e][2021-04-19T18:24:09]请求下载:https://aka.ms/vs/15/release/channel
[5330:001d][2021-04-19T18:24:09]正在尝试下载'https://aka.ms/vs/15/release/channel'使用引擎'WebClient'
[5330:001d][2021-04-19T18:24:09]网络客户端错误'RequestCancelled'带有'https://aka.ms/vs/15/release/channel'-GetWebResponse与取消请求一起失败
[5330:001d][2021-04-19T18:24:09]错误0x8013153b:[5330:001d][2021-04-19T18:24:09]无法更新频道“https://aka.ms/vs/15/release/channel"
在System.Threading.CancellationToken.ThrowoOperationCanceledException()中
在System.Threading.CancellationToken.ThrowIfCancellationRequested()中
在Microsoft.VisualStudio.Setup.Download.WebClient.GetWebResponse(Uri Uri、DownloadContext DownloadContext、DownloadSummary和DownloadSummary、HttpWebRequest和webRequest、CancellationToken CancellationToken)
在Microsoft.VisualStudio.Setup.Download.WebClient.DownloadCore(Uri Uri、Stream Stream、ProgressUpdateCallback progress、CancellationToken CancellationToken、DownloadContext DownloadContext、ITelemetryOperation遥测操作)
在Microsoft.VisualStudio.Setup.Download.DownloadEngineBase.DownloadWithBitRate(Uri Uri、流输出流、ProgressUpdateCallback进度、CancellationToken CancellationToken、DownloadContext DownloadContext、ITelemetryOperation遥测操作)
在Microsoft.VisualStudio.Setup.Download.DownloadEngineBase.Download(Uri Uri、Stream outputStream、ProgressUpdateCallback progress、CancellationToken CancellationToken、DownloadContext DownloadContext、ITelemetryOperation遥测操作)
在Microsoft.VisualStudio.Setup.Download.DownloadManager.DownloadWithRetry(IDownloadEngine[]引擎,Uri Uri,Stream outputStream,ProgressUpdateCallback进度,CancellationToken CancellationToken,DownloadContext DownloadContext,Boolean verifySignature)
在Microsoft.VisualStudio.Setup.Download.DownloadManager.c__DisplayClass23_0.b__0()上
在System.Threading.Tasks.Task`1.InnerInvoke()中
在System.Threading.Tasks.Task.Execute()中
---来自引发异常的上一个位置的堆栈结束跟踪---
在System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()中
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(任务任务)
在System.Runtime.CompilerServices.TaskWaiter.HandleNonSuccessAndDebuggerNotification(任务任务)中
在Microsoft.VisualStudio.Setup.ChannelManager.d_u85.MoveNext()上
---来自引发异常的上一个位置的堆栈结束跟踪---
在System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()中
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(任务任务)
在System.Runtime.CompilerServices.TaskWaiter.HandleNonSuccessAndDebuggerNotification(任务任务)中
在Microsoft.VisualStudio.Setup.ChannelManager.d_u77.MoveNext()上

没有别的事情发生。我该怎么办?

今天也有同样的问题。我刚刚让Windows Powershell在安装Node.JS for VS代码(不是Visual Studio)时停止并冻结了大约5分钟。控制台的最后一个输出是:

$创建了一个未提升的InstallerTeleMetryCorator

长话短说:由于安装程序仍在运行,我不得不退出终端(不喜欢此操作)并重新启动计算机。然后单击安装文件以运行Node.js安装向导(Node-v15.14.0-x64.msi)。有第二个选项可以修复安装尝试:“修复”。单击该按钮,安装向导完成修复并完全退出。程序注意到一些元素尚未完成。然后,您可以在终端的VS代码中运行javascript文件

我不必修复VS代码

从VS代码终端运行的示例(以粗体显示的终端条目)

PS“驱动器位置”\JavaScript>节点candrinkoifs.js

要在VSC中运行脚本,我需要打开文件夹(File->openfolder.),然后创建一个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"
    }]}
{
//使用IntelliSense了解可能的属性。
//悬停以查看现有属性的描述。
//有关更多信息,请访问:https://go.microsoft.com/fwlink/?linkid=830387
“版本”:“0.2.0”,
“配置”:[
{
“类型”:“pwa节点”,
“请求”:“启动”,
“名称”:“启动计划”,
“滑雪板”:[
"/**"
],
“程序”:“${workspaceFolder}\\candrinkoifs.js”
}]}
也发生在我身上。 只要安装过程继续进行,我认为这些特定的错误是无关紧要的。它可能需要一段时间才能完成,因为它需要大量的网络和CPU。如果所有设置过程都已完成,并且终端中的最后一条消息是共享的消息,则您可能已使用光标暂停该消息。只需按空格键或输入