question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ng add @angular/fire -> Package install failed

See original GitHub issue

Running ng add @angular/fire on a fresh install of Angular results into Package install failed

Version info

Angular: 13.1.2 Node: 16.13.1 npm: 8.1.2 Firebase: 10.0.1 AngularFire: 7.2.0 OS: macOS Monterey (12.0.1)

How to reproduce these conditions

ng new <project>
ng add @angular/fire (no matter which option is chosen)

Result

ℹ Using package manager: npm
✔ Found compatible package version: @angular/fire@7.2.0.
✔ Package information loaded.

The package @angular/fire@7.2.0 will be installed and executed.
Would you like to proceed? Yes
✔ Package successfully installed.
UPDATE package.json (1171 bytes)
✔ Packages installed successfully.
? What features would you like to setup? ng deploy -- hosting
✖ Package install failed.
/Users/<user>/Projects/<project>/node_modules/@angular-devkit/schematics/node_modules/rxjs/internal/util/hostReportError.js:4
    setTimeout(function () { throw err; }, 0);
                             ^

TypeError: Cannot read properties of undefined (reading 'message')
    at Object.error (/Users/<user>/Projects/<project>/node_modules/@angular/cli/models/schematic-command.js:432:47)
    at SafeSubscriber.__tryOrUnsub (/Users/<user>/Projects/<project>/node_modules/@angular-devkit/schematics/node_modules/rxjs/internal/Subscriber.js:205:16)
    at SafeSubscriber.error (/Users/<user>/Projects/<project>/node_modules/@angular-devkit/schematics/node_modules/rxjs/internal/Subscriber.js:156:26)
    at Subscriber._error (/Users/<user>/Projects/<project>/node_modules/@angular-devkit/schematics/node_modules/rxjs/internal/Subscriber.js:92:26)
    at Subscriber.error (/Users/<user>/Projects/<project>/node_modules/@angular-devkit/schematics/node_modules/rxjs/internal/Subscriber.js:72:18)
    at TapSubscriber._error (/Users/<user>/Projects/<project>/node_modules/@angular-devkit/schematics/node_modules/rxjs/internal/operators/tap.js:75:26)
    at TapSubscriber.Subscriber.error (/Users/<user>/Projects/<project>/node_modules/@angular-devkit/schematics/node_modules/rxjs/internal/Subscriber.js:72:18)
    at MergeMapSubscriber.SimpleOuterSubscriber.notifyError (/Users/<user>/Projects/<project>/node_modules/@angular-devkit/schematics/node_modules/rxjs/internal/innerSubscribe.js:72:26)
    at SimpleInnerSubscriber._error (/Users/<user>/Projects/<project>/node_modules/@angular-devkit/schematics/node_modules/rxjs/internal/innerSubscribe.js:30:21)
    at SimpleInnerSubscriber.Subscriber.error (/Users/<user>/Projects/<project>/node_modules/@angular-devkit/schematics/node_modules/rxjs/internal/Subscriber.js:72:18)

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:22
  • Comments:16

github_iconTop GitHub Comments

28reactions
HarryAllen1commented, Jan 19, 2022

I found that if you run npm i -D firebase-tools manually, this will fix the problem. If this doesn’t work, try: npm i -D firebase-tools@9

19reactions
rkoyamacommented, Jan 15, 2022

Had the same error message. Just ran the install script with sudo and got past it: sudo ng add @angular/fire

ng version output:

Angular CLI: 13.1.3
Node: 16.13.2
Package Manager: npm 8.3.1
OS: linux x64

Angular: 13.1.1
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1301.2
@angular-devkit/build-angular   13.1.2
@angular-devkit/core            13.1.2
@angular-devkit/schematics      13.1.3
@angular/cdk                    13.1.2
@angular/cli                    13.1.3
@angular/fire                   7.2.0
@angular/material               13.1.2
@schematics/angular             13.1.3
rxjs                            7.4.0
typescript                      4.5.4
Read more comments on GitHub >

github_iconTop Results From Across the Web

ng add @angular/fire "The package that you are trying to add ...
Yes ✔ Package successfully installed. The package that you are trying to add does not support schematics. You can try using a different...
Read more >
Install @AngularFire Error:The package that you are trying to ...
I am trying to install @angular/fire using the ng add @angular/fire command. However, I keep getting the error: The package that you are ......
Read more >
angular/fire - npm
The official Angular library for Firebase. ng add @angular/fire. AngularFire smooths over the rough edges an Angular developer might encounter ...
Read more >
angular/angularfire2 - Gitter
ERROR in node_modules/@angular/fire/firebase.app.module.d.ts(2,79): error TS2307: ... grpc@1.16.0 install /Users/rajkot-13/Desktop/ng-fire/node_modules/grpc ...
Read more >
Initialize Firebase in Angular applications using the ... - YouTube
Learn how to use the @ angular/fire schematic to install Firebase and AngularFire letting the CLI handle all the configuration for you.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found