Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error when installing necessary packages on Node js

I was installing Node.js on Windows. It installed successfully, and I also selected the option to install necessary files (such as chocolatey) in the node.js installer. After node was installed, it opened up Powershell; after installing for a while, I got this error:

# 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()

And nothing else is happening. What do I do?

like image 767
code Avatar asked Apr 20 '21 01:04

code


People also ask

Does nodejs require chocolatey?

You don't need Chocolatey in order to do web development. Having Chocolatey makes the automated installation and updating of the applications on your machine easier. By itself, Chocolatey doesn't do anything with regard to updating the underlying operating system.

Why does npm install fail?

The error in NPM, 'error package install failed, see above', can occur when the user creates a new project in Angular using Node. js using VS code. This means that NPM is corrupted in your system, and must reinstall NPM.


2 Answers

Same problem today. I just had Windows Powershell stop and freeze for about 5 minutes while installing Node.JS for VS Code (not Visual Studio). Last output from console is:

$ Created a UnelevatedInstallerTelemetryDecorator

Long story short: I had to exit the terminal (did not like this action) and reboot the computer because the install program was still running. Then I clicked on the installation file to run the Node.js Setup Wizard (node-v15.14.0-x64.msi). There is a second option to repair the install attempt: "Repair". Click on that button and the install wizard completes the repair with full exit. The program notices that some elements have not been completed. Then you can run a javascript file at the terminal in VS Code.

I did not have to repair VS Code.

Sample run from VS Code Terminal (terminal entry in bold)

PS "Drive Location"\JavaScript> node canDrinkNoIfs.js

To run the script in VSC I need to open the folder (File -> open folder.) and then create a json file to run and debug code. This json file is saved the .vscode subfolder.

{
// 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"
    }]}
like image 56
Joseph Avatar answered Sep 20 '22 03:09

Joseph


The additional tools install a number of items and their dependencies as mentioned when progressing through the script. These items would be used in case any node modules need to be compiled with these tools.

This script will install Python and the Visual Studio Build Tools, necessary to compile Node.js native modules. Note that Chocolatey and required Windows updates will also be installed.

This will require about 3 Gb of free disk space, plus any space necessary to install Windows updates. This will take a while to run.

Example for node-v16.13.0-x64.msi

- https://chocolatey.org/packages/chocolatey
- https://chocolatey.org/packages/python
- https://chocolatey.org/packages/visualstudio2019-workload-vctools

In particular the visualstudio2019-workload-vctools involves the download of 1.6 gig of build tools, which can take awhile.

If you are wondering if things are progressing, try to launch Visual Studio Installer. If it is still running, you might get a message that says "Cannot start another instance of the installer while this instance is running."

If you've exited, rebooted, and relaunched the script and you're still wondering if all the tools got installed you can do the following:

  • Type choco list -lo to see if the packages visualstudio-installer, visualstudio2019-workload-vctools, and visualstudio2019buildtools are installed
  • open the Visual Studio Installer and you can see if the installer has completed installing the build tools. It may need to be resumed. Visual Studio Installer progress
like image 33
jtessier72 Avatar answered Sep 21 '22 03:09

jtessier72