【问题标题】:Error when installing necessary packages on Node js在 Node js 上安装必要的包时出错
【发布时间】:2021-04-20 01:33:22
【问题描述】:

我在 Windows 上安装 Node.js。它安装成功,我还在 node.js 安装程序中选择了安装必要文件(例​​如巧克力)的选项。 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()

没有其他事情发生。我该怎么办?

【问题讨论】:

    标签: node.js visual-studio powershell installation


    【解决方案1】:

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

    $ 创建了一个 UnelevatedInstallerTelemetryDecorator

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

    我不必修复 VS Code。

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

    PS "Drive Location"\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"
        }]}
    

    【讨论】:

    • 那么您使用的是 VSC 还是 Node.js?您是否尝试重新运行 PowerShell 脚本?如果是这样,您是否再次收到错误?
    • 我正在使用 Node.js。我还没有为 VSC 设置 json 文件。该脚本在 VSC 中编辑,然后在 Windows Powershell 中使用节点运行。这与在 Linux 中使用 javascript 的方式相同。我也没有运行 Node.js 的安装脚本。 Node.js 安装向导解决了这个问题。我确实需要创建一个 json 文件,以便可以使用 VSC 中的运行和调试按钮。
    • 编辑:让我在 VSC 中运行脚本 - 打开脚本文件夹并保存 .vscode 子文件夹。 (可能有更好的方法,但这对我有用。)在VSC(1)文件->打开文件夹(2)运行和调试->创建一个launch.json文件->从下拉列表中选择Node.js。脚本在 VSC 调试控制台和终端中运行。
    【解决方案2】:

    它发生在我身上。

    首先尝试使用spacetab。在我的第一站 powershell 中

    Download of vs_BuildTools.exe (1.4 MB) completed.
    Hashes match.
    Installing visualstudio2017buildtools...
    

    工作中...

    伙计们,如果您使用空格或制表符,然后工作:这是因为您在 PowerShell 中使用单击鼠标,不要这样做,有时会暂停程序 :) [如果工作正常,是正常错误,并且不会对完成下载造成任何危险]

    但是我有很多白色文本。 最后一站是

    [1968:0007][2021-08-24T19:47:57] Created a UnelevatedInstallerTelemetryDecorator
    

    here the error you have.❌

    为了纠正这个错误......这样做!

    • 转到边缘(或您选择下载的浏览器)
    • 去下载标签,那里有node-v14.17.5-x64.msi(对于边缘是CTRL+J
    • 打开文件
    • 点击修复 就是这样

    如果你需要,我会放一些最终结果的照片:

    final result SUCCESS✅

    编辑

    过了一会儿我有了这个,在同一个 powershell 中我有第一站。

    Chocolatey timed out waiting for the command to finish. The timeout
     specified (or the default value) was '2700' seconds. Perhaps try a
     higher `--execution-timeout`? See `choco -h` for details.
      visualstudio2017-workload-vctools may be able to be automatically uninstalled.
    The upgrade of visualstudio2017-workload-vctools was NOT successful.
    Error while running 'C:\ProgramData\chocolatey\lib\visualstudio2017-workload-vctools\tools\ChocolateyInstall.ps1'.
     See log for details.
    
    Chocolatey upgraded 15/17 packages. 2 packages failed.
     See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
    
    Upgraded:
     - chocolatey-dotnetfx.extension v1.0.1
     - kb3033929 v1.0.5
     - visualstudio2017buildtools v15.9.38.0
     - chocolatey-windowsupdate.extension v1.0.4
     - vcredist140 v14.29.30133
     - kb2999226 v1.0.20181019
     - visualstudio-installer v2.0.1
     - kb2919355 v1.0.20160915
     - chocolatey-core.extension v1.3.5.1
     - kb2919442 v1.0.20160915
     - chocolatey-visualstudio.extension v1.9.0
     - vcredist2015 v14.0.24215.20170201
     - dotnetfx v4.8.0.20190930
     - kb3035131 v1.0.3
     - python v3.9.6
    
    Failures
     - python3 (exited 1603) - Error while running 'C:\ProgramData\chocolatey\lib\python3\tools\chocolateyInstall.ps1'.
     See log for details.
     - visualstudio2017-workload-vctools (exited -1) - Error while running 'C:\ProgramData\chocolatey\lib\visualstudio2017-workload-vctools\tools\ChocolateyInstall.ps1'.
     See log for details.
    

    最后是TYPE ENTER FOR EXIT - message on powershell

    如果您看到最后一条消息。

    See "choco -h" for details. 所以,我在 PowerShell 中编写它。

    我有这个结果,带有绿色消息,最后是版本

    This is a listing of all of the different things you can pass to choco.
    
    Commands
    
     * list - lists remote or local packages
     * find - searches remote or local packages (alias for search)
     * search - searches remote or local packages (alias for list)
     * info - retrieves package information. Shorthand for choco search pkgname --exact --verbose
     * install - installs packages from various sources
     * pin - suppress upgrades for a package
     * outdated - retrieves packages that are outdated. Similar to upgrade all --noop
     * upgrade - upgrades packages from various sources
     * uninstall - uninstalls a package
     * pack - packages up a nuspec to a compiled nupkg
     * push - pushes a compiled nupkg
     * new - generates files necessary for a chocolatey package from a template
     * sources - view and configure default sources (alias for source)
     * source - view and configure default sources
     * config - Retrieve and configure config file settings
     * feature - view and configure choco features
     * features - view and configure choco features (alias for feature)
     * setapikey - retrieves, saves or deletes an apikey for a particular source (alias for apikey)
     * apikey - retrieves, saves or deletes an apikey for a particular source
     * unpackself - have chocolatey set itself up
     * version - [DEPRECATED] will be removed in v1 - use `choco outdated` or `cup <pkg|all> -whatif` instead
     * update - [DEPRECATED] RESERVED for future use (you are looking for upgrade, these are not the droids you are looking for)
    
    
    Please run chocolatey with `choco command -help` for specific help on
     each command.
    
    How To Pass Options / Switches
    
    You can pass options and switches in the following ways:
    
     * Unless stated otherwise, an option/switch should only be passed one
       time. Otherwise you may find weird/non-supported behavior.
     * `-`, `/`, or `--` (one character switches should not use `--`)
     * **Option Bundling / Bundled Options**: One character switches can be
       bundled. e.g. `-d` (debug), `-f` (force), `-v` (verbose), and `-y`
       (confirm yes) can be bundled as `-dfvy`.
     * NOTE: If `debug` or `verbose` are bundled with local options
       (not the global ones above), some logging may not show up until after
       the local options are parsed.
     * **Use Equals**: You can also include or not include an equals sign
       `=` between options and values.
     * **Quote Values**: When you need to quote an entire argument, such as
       when using spaces, please use a combination of double quotes and
       apostrophes (`"'value'"`). In cmd.exe you can just use double quotes
       (`"value"`) but in powershell.exe you should use backticks
       (`` `"value`" ``) or apostrophes (`'value'`). Using the combination
       allows for both shells to work without issue, except for when the next
       section applies.
     * **Pass quotes in arguments**: When you need to pass quoted values to
       to something like a native installer, you are in for a world of fun. In
       cmd.exe you must pass it like this: `-ia "/yo=""Spaces spaces"""`. In
       PowerShell.exe, you must pass it like this: `-ia '/yo=""Spaces spaces""'`.
       No other combination will work. In PowerShell.exe if you are on version
       v3+, you can try `--%` before `-ia` to just pass the args through as is,
       which means it should not require any special workarounds.
     * **Periods in PowerShell**: If you need to pass a period as part of a
       value or a path, PowerShell doesn't always handle it well. Please
       quote those values using "Quote Values" section above.
     * Options and switches apply to all items passed, so if you are
       installing multiple packages, and you use `--version=1.0.0`, choco
       is going to look for and try to install version 1.0.0 of every
       package passed. So please split out multiple package calls when
       wanting to pass specific options.
    
    Scripting / Integration - Best Practices / Style Guide
    
    When writing scripts, such as PowerShell scripts passing options and
    switches, there are some best practices to follow to ensure that you
    don't run into issues later. This also applies to integrations that
    are calling Chocolatey and parsing output. Chocolatey **uses**
    PowerShell, but it is an exe, so it cannot return PowerShell objects.
    
    Following these practices ensures both readability of your scripts AND
    compatibility across different versions and editions of Chocolatey.
    Following this guide will ensure your experience is not frustrating
    based on choco not receiving things you think you are passing to it.
    
     * For consistency, always use `choco`, not `choco.exe`. Never use
       shortcut commands like `cinst` or `cup`.
     * Always have the command as the first argument to `choco. e.g.
       `choco install`, where `install` is the command.
     * If there is a subcommand, ensure that is the second argument. e.g.
       `choco source list`, where `source` is the command and `list` is the
       subcommand.
     * Typically the subject comes next. If installing packages, the
       subject would be the package names, e.g. `choco install pkg1 pkg2`.
     * Never use 'nupkg' or point directly to a nupkg file UNLESS using
       'choco push'. Use the source folder instead, e.g. `choco install
       <package id> --source="'c:\folder\with\package'"` instead of
       `choco install DoNotDoThis.1.0.nupkg` or `choco install DoNotDoThis
        --source="'c:\folder\with\package\DoNotDoThis.1.0.nupkg'"`.
     * Switches and parameters are called simply options. Options come
       after the subject. e.g. `choco install pkg1 --debug --verbose`.
     * Never use the force option (`--force`/`-f`) in scripts (or really
       otherwise as a default mode of use). Force is an override on
       Chocolatey behavior. If you are wondering why Chocolatey isn't doing
       something like the documentation says it should, it's likely because
       you are using force. Stop.
     * Always use full option name. If the short option is `-n`, and the
       full option is `--name`, use `--name`. The only acceptable short
       option for use in scripts is `-y`. Find option names in help docs
       online or through `choco -?` /`choco [Command Name] -?`.
     * For scripts that are running automated, always use `-y`. Do note
       that even with `-y` passed, some things / state issues detected will
       temporarily stop for input - the key here is temporarily. They will
       continue without requiring any action after the temporary timeout
       (typically 30 seconds).
     * Full option names are prepended with two dashes, e.g. `--` or
       `--debug --verbose --ignore-proxy`.
     * When setting a value to an option, always put an equals (`=`)
       between the name and the setting, e.g. `--source="'local'"`.
     * When setting a value to an option, always surround the value
       properly with double quotes bookending apostrophes, e.g.
       `--source="'internal_server'"`.
     * If you are building PowerShell scripts, you can most likely just
       simply use apostrophes surrounding option values, e.g.
       `--source='internal_server'`.
     * Prefer upgrade to install in scripts. You can't `install` to a newer
       version of something, but you can `choco upgrade` which will do both
       upgrade or install (unless switched off explicitly).
     * If you are sharing the script with others, pass `--source` to be
       explicit about where the package is coming from. Use full link and
       not source name ('https://chocolatey.org/api/v2' versus
       'chocolatey').
     * If parsing output, you might want to use `--limit-output`/`-r` to
       get output in a more machine parseable format. NOTE: Not all
       commands handle return of information in an easily digestible
       output.
     * Use exit codes to determine status. Chocolatey exits with 0 when
       everything worked appropriately and other exits codes like 1 when
       things error. There are package specific exit codes that are
       recommended to be used and reboot indicating exit codes as well. To
       check exit code when using PowerShell, immediately call
       `$exitCode = $LASTEXITCODE` to get the value choco exited with.
    
    Here's an example following bad practices (line breaks added for
     readability):
    
      `choco install pkg1 -y -params '/Option:Value /Option2:value with
       spaces' --c4b-option 'Yaass' --option-that-is-new 'dude upgrade'`
    
    Now here is that example written with best practices (again line
     breaks added for readability - there are not line continuations
     for choco):
    
      `choco upgrade pkg1 -y --source="'https://chocolatey.org/api/v2'"
       --package-parameters="'/Option:Value /Option2:value with spaces'"
       --c4b-option="'Yaass'" --option-that-is-new="'dude upgrade'"`
    
    Note the differences between the two:
     * Which is more self-documenting?
     * Which will allow for the newest version of something installed or
       upgraded to (which allows for more environmental consistency on
       packages and versions)?
     * Which may throw an error on a badly passed option?
     * Which will throw errors on unknown option values? See explanation
       below.
    
    Chocolatey ignores options it doesn't understand, but it can only
     ignore option values if they are tied to the option with an
     equals sign ('='). Note those last two options in the examples above?
     If you roll off of a commercial edition or someone with older version
     attempts to run the badly crafted script `--c4b-option 'Yaass'
     --option-that-is-new 'dude upgrade'`, they are likely to see errors on
     'Yaass' and 'dude upgrade' because they are not explicitly tied to the
     option they are written after. Now compare that to the other script.
     Choco will ignore `--c4b-option="'Yaass'"` and
     `--option-that-is-new="'dude upgrade'"` as a whole when it doesn't
     register the options. This means that your script doesn't error.
    
    Following these scripting best practices will ensure your scripts work
     everywhere they are used and with newer versions of Chocolatey.
    
    
    Default Options and Switches
    
     -?, --help, -h
         Prints out the help menu.
    
     -d, --debug
         Debug - Show debug messaging.
    
     -v, --verbose
         Verbose - Show verbose messaging. Very verbose messaging, avoid using
           under normal circumstances.
    
         --trace
         Trace - Show trace messaging. Very, very verbose trace messaging. Avoid
           except when needing super low-level .NET Framework debugging. Available
           in 0.10.4+.
    
         --nocolor, --no-color
         No Color - Do not show colorization in logging output. This overrides
           the feature 'logWithoutColor', set to 'False'. Available in 0.10.9+.
    
         --acceptlicense, --accept-license
         AcceptLicense - Accept license dialogs automatically. Reserved for
           future use.
    
     -y, --yes, --confirm
         Confirm all prompts - Chooses affirmative answer instead of prompting.
           Implies --accept-license
    
     -f, --force
         Force - force the behavior. Do not use force during normal operation -
           it subverts some of the smart behavior for commands.
    
         --noop, --whatif, --what-if
         NoOp / WhatIf - Don't actually do anything.
    
     -r, --limitoutput, --limit-output
         LimitOutput - Limit the output to essential information
    
         --timeout, --execution-timeout=VALUE
         CommandExecutionTimeout (in seconds) - The time to allow a command to
           finish before timing out. Overrides the default execution timeout in the
           configuration of 2700 seconds. '0' for infinite starting in 0.10.4.
    
     -c, --cache, --cachelocation, --cache-location=VALUE
         CacheLocation - Location for download cache, defaults to %TEMP% or value
           in chocolatey.config file.
    
         --allowunofficial, --allow-unofficial, --allowunofficialbuild, --allow-unofficial-build
         AllowUnofficialBuild - When not using the official build you must set
           this flag for choco to continue.
    
         --failstderr, --failonstderr, --fail-on-stderr, --fail-on-standard-error, --fail-on-error-output
         FailOnStandardError - Fail on standard error output (stderr), typically
           received when running external commands during install providers. This
           overrides the feature failOnStandardError.
    
         --use-system-powershell
         UseSystemPowerShell - Execute PowerShell using an external process
           instead of the built-in PowerShell host. Should only be used when
           internal host is failing. Available in 0.9.10+.
    
         --no-progress
         Do Not Show Progress - Do not show download progress percentages.
           Available in 0.10.4+.
    
         --proxy=VALUE
         Proxy Location - Explicit proxy location. Overrides the default proxy
           location of ''. Available for config settings in 0.9.9.9+, this CLI
           option available in 0.10.4+.
    
         --proxy-user=VALUE
         Proxy User Name - Explicit proxy user (optional). Requires explicity
           proxy (`--proxy` or config setting). Overrides the default proxy user of
           ''. Available for config settings in 0.9.9.9+, this CLI option available
           in 0.10.4+.
    
         --proxy-password=VALUE
         Proxy Password - Explicit proxy password (optional) to be used with
           username. Requires explicity proxy (`--proxy` or config setting) and
           user name.  Overrides the default proxy password (encrypted in settings
           if set). Available for config settings in 0.9.9.9+, this CLI option
           available in 0.10.4+.
    
         --proxy-bypass-list=VALUE
         ProxyBypassList - Comma separated list of regex locations to bypass on
           proxy. Requires explicity proxy (`--proxy` or config setting). Overrides
           the default proxy bypass list of ''. Available in 0.10.4+.
    
         --proxy-bypass-on-local
         Proxy Bypass On Local - Bypass proxy for local connections. Requires
           explicity proxy (`--proxy` or config setting). Overrides the default
           proxy bypass on local setting of 'True'. Available in 0.10.4+.
    
         --log-file=VALUE
         Log File to output to in addition to regular loggers. Available in 0.1-
           0.8+.
    Chocolatey v0.10.15
    

    最重要的是:

    `巧克力 v0.10.15`

    chocolatey v.0.10.15 message

    好的,让我们测试一下是否安装了 npm :)

    首先写:npm -version

    如果返回一个版本,你很好!!!! ?

    现在你可以从 npm 安装了!

    例如:我安装tailwindcss

    • 去tailwindcss网站

    • 复制npm代码npm install tailwindcss

    • 转到 vs 代码并粘贴它。

      PS C:\Users\laaou\Desktop> npm -version 6.14.14
      PS C:\Users\laaou\Desktop> npm install tailwindcss npm WARN saveError ENOENT: 没有这样的文件或目录,打开 'C:\Users\laaou\package.json' npm WARN enoent ENOENT:没有这样的文件或目录,打开 'C:\Users\laaou\package.json' npm WARN tailwindcss@2.2.7 需要一个对等的 autoprefixer@^10.0.2 但没有安装。您必须自己安装对等依赖项。 npm WARN laaou 无描述 npm WARN laaou 没有存储库字段。 npm WARN laaou 没有 README 数据
      npm WARN laaou 没有许可证字段。 npm WARN 可选跳过可选依赖:fsevents@2.3.2 (node_modules\fsevents): npm WARN notsup 跳过可选依赖:fsevents@2.3.2 不受支持的平台:想要 {"os":"darwin","arch":"any"}(当前:{"os":"win32","arch": "x64"})

    • tailwindcss@2.2.7 在 3.857 秒内更新了 1 个包并审核了 180 个包

    17 个软件包正在寻找资金 运行npm fund了解详情

    发现 0 个漏洞

    PS C:\Users\laaou\Desktop>

    • 如果您有兴趣,请尝试使用 npm fund

    【讨论】:

      【解决方案3】:

      也发生在我身上。 只要设置过程继续进行,我认为这些特定错误是微不足道的。可能需要一段时间才能完成,因为它使用大量网络和 CPU。如果所有设置过程都已完成并且终端中的最后一条消息是共享的,则您可能用光标暂停了它。只需按spaceenter,终端就会释放。

      【讨论】:

      • 用光标暂停进程会导致错误?
      • @code 否定,我的意思是这个过程可能已经完成了,但是日志没有被刷新到终端,因为它被暂停了
      【解决方案4】:

      附加工具会安装许多项目及其依赖项,如在执行脚本时提到的那样。如果需要使用这些工具编译任何节点模块,将使用这些项目。

      此脚本将安装 Python 和 Visual Studio 构建工具,这是必要的 编译 Node.js 原生模块。请注意 Chocolatey 和所需的 Windows 还将安装更新。

      这将需要大约 3 Gb 的可用磁盘空间,外加任何必要的空间 安装 Windows 更新。这需要一段时间才能运行。

      node-v16.13.0-x64.msi 的示例

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

      特别是 visualstudio2019-workload-vctools 涉及下载 1.6 gig 的构建工具,这可能需要一段时间。

      如果您想知道事情是否进展顺利,请尝试启动 Visual Studio 安装程序。如果它仍在运行,您可能会收到一条消息“无法在此实例运行时启动安装程序的另一个实例。”

      如果您已退出、重新启动并重新启动脚本,但您仍然想知道是否已安装所有工具,您可以执行以下操作:

      • 键入choco list -lo 以查看是否安装了包visualstudio-installervisualstudio2019-workload-vctoolsvisualstudio2019buildtools
      • 打开Visual Studio 安装程序,可以看到安装程序是否已完成构建工具的安装。它可能需要恢复。

      【讨论】:

      • 谢谢兄弟!很高兴知道有像 Visual Studio Installer 这样的东西...当 PowerShell 卡住时 - 唯一想到的是出了点问题,但它应该只打开 VS Installer 以便用户可以跟踪进度...
      猜你喜欢
      • 1970-01-01
      • 2019-04-17
      • 2018-08-25
      • 2015-04-27
      • 1970-01-01
      • 2018-06-21
      • 2014-02-05
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多