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
- fix: exception while running command ng deploy (#2088) When we execute `ng deploy` command, `workspace.root` gives wrong path in Windows environment, thats why it doesn't work in Windows environment.... — committed to ngdevelop-tech/angularfire2 by ngdevelop-tech 5 years ago
- fix(schematics): fix issues with FS and Devkit Paths Angular devkit paths are not interchangable with Node FS paths. Closes #2088 — committed to alan-agius4/angularfire by alan-agius4 4 years ago
- fix(schematics): fix issues with FS and Devkit Paths Angular devkit paths are not interchangeable with Node FS paths. Closes #2088 — committed to alan-agius4/angularfire by alan-agius4 4 years ago
- fix(schematics): fix issues with FS and Devkit Paths (#2279) Angular devkit paths are not interchangeable with Node FS paths. Closes #2088 — committed to angular/angularfire by alan-agius4 4 years ago
- fix(schematics): fix issues with FS and Devkit Paths (#2279) Angular devkit paths are not interchangeable with Node FS paths. Closes #2088 — committed to angular/angularfire by alan-agius4 4 years ago
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"));
withconst { 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);
withyield 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
.