Skip to content

completion.ts: hasGlobalCliInstall requires "which" #23997

Closed

Description

@tjni

Command

build

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

When which does not exist on the path, hasGlobalCliInstall does not resolve its promise. Then, maybe due to nodejs/node#22088, the process exits prematurely.

Minimal Reproduction

I got here running ng build from a nixpkgs build of PeerTube, which has a lot of layers, but this phenomenon of early exiting can be reproduced with a simple example:

const { execFile } = require('child_process');

(async function main () {
  const proc = execFile("blah");

  const exitCode = await new Promise((resolve) => {
    proc.addListener('exit', (exitCode) => {
      resolve(exitCode);
    });
  });

  console.log("Exit code:", exitCode);
})();

Exception or Error

No response

Your Environment

❯ node_modules/.bin/ng version                                                                                                         took 19s

     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/


Angular CLI: 14.2.2
Node: 18.9.0 (Unsupported)
Package Manager: yarn 1.22.19
OS: darwin arm64

Angular: 14.2.1
... animations, cdk, common, compiler, compiler-cli, core, forms
... localize, platform-browser, platform-browser-dynamic, router
... service-worker

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1402.2
@angular-devkit/build-angular   14.2.2
@angular-devkit/core            14.2.2
@angular-devkit/schematics      14.2.2
@angular/cli                    14.2.2
@schematics/angular             14.2.2
rxjs                            7.5.6
typescript                      4.8.3
webpack                         5.74.0

Anything else relevant?

No response

Activity

  1. added
    freq1: low
    on Oct 3, 2022
  2. mostafaadelsalah commented on Oct 4, 2022

    @mostafaadelsalah
  3. added a commit that references this issue on Oct 7, 2022
    e3711fb
  4. self-assigned this
    on Oct 7, 2022
  5. added a commit that references this issue on Oct 7, 2022
    0cbb1d7
  6. added 2 commits that reference this issue on Oct 7, 2022
    4fa5b52
    1c9cf59
  7. angular-automatic-lock-bot commented on Nov 7, 2022

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  8. locked and limited conversation to collaborators on Nov 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area: @angular/clifreq1: lowseverity3: brokentype: bug/fix

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions