Skip to content

ng add @angular/pwa generate an unhandled exception occurred: Cannot find module '@schematics/angular/utility' #23343

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

Closed
2 of 15 tasks
k4rm3l0 opened this issue Jun 10, 2022 · 4 comments
Labels
area: @angular/pwa freq1: low Only reported by a handful of users who observe it rarely severity5: regression type: bug/fix

Comments

@k4rm3l0
Copy link

k4rm3l0 commented Jun 10, 2022

🐞 Bug report

Command

  • new
  • build
  • serve
  • test
  • e2e
  • generate
  • add
  • update
  • lint
  • extract-i18n
  • run
  • config
  • help
  • version
  • doc

Description

Command "ng add @angular/pwa" generate an unhandled exception occurred: Cannot find module '@schematics/angular/utility'

🔬 Minimal Reproduction

ng add @angular/pwa --project my.project

🔥 Exception or Error

ℹ Using package manager: npm
✔ Found compatible package version: @angular/[email protected].
✔ Package information loaded.

The package @angular/[email protected] will be installed and executed.
Would you like to proceed? Yes
✔ Package successfully installed.
An unhandled exception occurred: Cannot find module '@schematics/angular/utility'
Require stack:

  • myproject/node_modules/@angular/cli/models/schematic-engine-host.js
    See "/private/var/folders/kk/7f9l6gdn0mjcvzmzbn9vfxz40000gn/T/ng-lcv9gi/angular-errors.log" for further details.

🌍 Your Environment


Angular CLI: 13.3.7
Node: 16.14.0
Package Manager: npm 8.3.1
OS: darwin arm64

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

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1303.7
@angular-devkit/build-angular   13.3.7
@angular-devkit/core            13.3.7
@angular-devkit/schematics      13.3.7
@angular/cli                    13.3.7
@schematics/angular             13.3.7
rxjs                            7.5.5
typescript                      4.6.4
@k4rm3l0 k4rm3l0 changed the title ng add @angular/pwa results in a unhandled exception occurred: Cannot find module '@schematics/angular/utility' ng add @angular/pwa generate an unhandled exception occurred: Cannot find module '@schematics/angular/utility' Jun 10, 2022
@alan-agius4
Copy link
Collaborator

@k4rm3l0 can you please try to run ng add @angular/pwa@13?

alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Jun 10, 2022
The peer dependency is needed so that the correct version that matches the installed Angular CLI is installed.

(cherry picked from commit d59ba31)

Closes angular#23343
@alan-agius4 alan-agius4 added freq1: low Only reported by a handful of users who observe it rarely severity5: regression type: bug/fix area: @angular/pwa labels Jun 10, 2022
@k4rm3l0
Copy link
Author

k4rm3l0 commented Jun 10, 2022

@alan-agius4 it worked!

clydin pushed a commit that referenced this issue Jun 10, 2022
The peer dependency is needed so that the correct version that matches the installed Angular CLI is installed.

(cherry picked from commit d59ba31)

Closes #23343
@alan-agius4
Copy link
Collaborator

Closed via #23344

piotrszymanski added a commit to piotrszymanski/pwa-experiment-one that referenced this issue Jun 20, 2022
Ran:
ng add @angular/pwa@13
as the latest version (14) was giving errors due to this bug:
angular/angular-cli#23343
@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 Jul 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: @angular/pwa freq1: low Only reported by a handful of users who observe it rarely severity5: regression type: bug/fix
Projects
None yet
Development

No branches or pull requests

2 participants