Skip to content

ng add returns [Inquirer] Hook functions can only be called from within a prompt #1539

@darkedges

Description

@darkedges

Describe the bug

Get an An unhandled exception occurred: [Inquirer] Hook functions can only be called from within a prompt See "/tmp/ng-zZYvvU/angular-errors.log" for further details. when using ng add @angular/material via a Terminal.

❯ ng add @angular/material
✔ Determining Package Manager
  › Using package manager: npm
✔ Searching for compatible package version
  › Found compatible package version:
    @angular/[email protected].
✔ Loading package information from registry
✖ [Inquirer] Hook functions can only be called from
  within a prompt
An unhandled exception occurred: [Inquirer] Hook functions can only be called from within a prompt
See "/tmp/ng-zZYvvU/angular-errors.log" for further details.

Link to the blitz that caused the error

https://stackblitz.com/edit/stackblitz-starters-a7sdtp?file=src%2Findex.html

Steps to reproduce

  1. issue ng add @angular/material in a terminal
  2. get the error

Expected behavior

Angular Schematics for Angular Material should be deployed to the project.

Parity with Local

Screenshots

image

Platform

Browser name  = Chrome
Full version  = 129.0.0.0
Major version = 129
navigator.appName = Netscape
navigator.userAgent = Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36 Edg/129.0.0.0
performance.memory = {
  "totalJSHeapSize": 81354125,
  "usedJSHeapSize": 73755453,
  "jsHeapSizeLimit": 4294705152
}
Hash = 134daa3c

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions