angularfire: Exception while running command: ng run x:deploy

Version info

Angular: 8.0.0

Firebase: 6.1.0

AngularFire: 5.2.0-rc.1

OS: Windows 10 Pro (Version: 1809)

How to reproduce these conditions

Failing test unit, Plunkr, or JSFiddle demonstrating the problem

Steps to set up and reproduce

Sample data and security rules

Debug output

Errors in the JavaScript console

C:\Users\X\Documents\X\X\X>ng run Admin:deploy
ENOENT: no such file or directory, open '\C\Users\X\Documents\X\X\X\.firebaserc'
Error: ENOENT: no such file or directory, open '\C\Users\X\Documents\X\X\X\.firebaserc'
    at Object.openSync (fs.js:431:3)
    at Object.readFileSync (fs.js:333:35)
    at Object.getFirebaseProjectName (C:\Users\X\Documents\X\X\X\node_modules\@angular\fire\schematics\utils.js:53:41)
    at Object.<anonymous> (C:\Users\X\Documents\X\X\X\node_modules\@angular\fire\schematics\deploy\builder.js:26:37)
    at Generator.next (<anonymous>)
    at fulfilled (C:\Users\X\Documents\X\X\X\node_modules\@angular\fire\schematics\deploy\builder.js:4:58)

Output from firebase.database().enableLogging(true);

Screenshots

Expected behavior

Running the following command ng run x:deploy have to successfully build and deploy the project to Firebase Hosting.

Note: the x above is the project name.

Actual behavior

Fails at the beginning to find .firebaserc file but it exists. I figured out the path \C\Users\X\Documents\X\X\X\.firebaserc is wrong.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 9
  • Comments: 25 (1 by maintainers)

Commits related to this issue

Most upvoted comments

I am able to fix this issue by doing the following changes :

In \node_modules@angular\fire\schematics\utils.js > In getFirebaseProjectName method replace const { targets } = JSON.parse(fs_1.readFileSync(path_1.join(projectRoot, ".firebaserc"), "UTF-8")); with const { targets } = JSON.parse(fs_1.readFileSync(".firebaserc", "UTF-8"));

and In \node_modules@angular\fire\schematics\deploy\builder.js replace yield actions_1.default(require("firebase-tools"), context, core_1.join(workspace.root, project.root), firebaseProject); with yield actions_1.default(require("firebase-tools"), context, project.root, firebaseProject);

got the same issue

Temporary workaround if you don’t want to change the core files: Add "deploy" : "ng build && firebase deploy" to scripts in package.json Run: npm run deploy.