Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

completion.ts: hasGlobalCliInstall requires "which" #23997

Closed
1 task
tjni opened this issue Oct 3, 2022 · 2 comments · Fixed by #24036
Closed
1 task

completion.ts: hasGlobalCliInstall requires "which" #23997

tjni opened this issue Oct 3, 2022 · 2 comments · Fixed by #24036
Assignees
Labels
area: angular/cli freq1: low Only reported by a handful of users who observe it rarely severity3: broken type: bug/fix

Comments

@tjni
Copy link

tjni commented Oct 3, 2022

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

@mostafaadelsalah

This comment was marked as spam.

alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Oct 7, 2022
This change updates the `hasGlobalCliInstall` logic so that a pending promis is not created.

Closes angular#23997
@alan-agius4 alan-agius4 self-assigned this Oct 7, 2022
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Oct 7, 2022
This change updates the `hasGlobalCliInstall` logic so that a pending promise is not created.

Closes angular#23997
clydin pushed a commit that referenced this issue Oct 7, 2022
This change updates the `hasGlobalCliInstall` logic so that a pending promise is not created.

Closes #23997
clydin pushed a commit that referenced this issue Oct 7, 2022
This change updates the `hasGlobalCliInstall` logic so that a pending promise is not created.

Closes #23997

(cherry picked from commit 4fa5b52)
@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Nov 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: angular/cli freq1: low Only reported by a handful of users who observe it rarely severity3: broken type: bug/fix
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants