angularfire icon indicating copy to clipboard operation
angularfire copied to clipboard

Exception while running command: ng run x:deploy

Open meness opened this issue 7 years ago • 25 comments

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.

meness avatar May 29 '19 12:05 meness

Did you first run ng add @angular/fire@next? If so I'll run this on a Windows machine at next opportunity and find the problem with the schematic.

jamesdaniels avatar May 30 '19 14:05 jamesdaniels

Did you first run ng add @angular/fire@next? If so I'll run this on a Windows machine at next opportunity and find the problem with the schematic.

Yes, I did. Thanks!

meness avatar May 30 '19 15:05 meness

Hi ! Amazing command ! But I got the same issue :disappointed:

Angular 8 + ng add @angular/fire@next

Works on Linux but not on Windows

PastaBolo avatar May 31 '19 08:05 PastaBolo

Im getting the same issue.

kostenickj avatar Jun 02 '19 08:06 kostenickj

I have the same problem with angular 8 on windows. This issue helped me: #2101

msivri avatar Jun 07 '19 23:06 msivri

got the same issue

iamkanishka avatar Jul 10 '19 17:07 iamkanishka

Getting same issue with Angular 8.2.0 and @angular/[email protected]

ngdevelop-tech avatar Aug 17 '19 19:08 ngdevelop-tech

Same issue. I'm using @angular/core 8.2.0 and @angular/fire 5.2.1.

Jeanlo avatar Aug 20 '19 21:08 Jeanlo

Same Issue: testing deploy angular cli 8.3.0 @angular/fire 5.2.1 windows 10

emapettinato avatar Aug 23 '19 13:08 emapettinato

Same problem on windows.

This is what I did to launch my application: (1) make sure public directory is set to dist/<project name> All the tutorials says dist but that does not work. It needs the project folder path. (2) since ng deploy does not work and ng build --prod gives errors, I use ng build. (3) After I did all the above I do firebase deploy and that's it. That means @angular/fire was practically not used.

Crisp3333 avatar Aug 23 '19 18:08 Crisp3333

Updated Node to latest Angular cli to latest yarn still shows as 1.15.2 though I updated that too 0_o did a ng update --all then requested rxjs be updated explicitly

Same error and result

Can concur with Crisp3333, bypassed the new command a few weeks ago with the manual process.

JoeWorker avatar Sep 03 '19 15:09 JoeWorker

Same issue on Windows 10 | @angular/cli 8.3.3 | @angular/fire 5.2.1

C:\Users\User\projects\test> ng deploy
An unhandled exception occurred: ENOENT: no such file or directory, open '\C\Users\User\projects\test\.firebaserc'
See "C:\Users\User\AppData\Local\Temp\ng-dWxjal\angular-errors.log" for further details.

IdanCo avatar Sep 06 '19 07:09 IdanCo

same issue on windows 10 and stable node version

FerLuisxd avatar Sep 08 '19 00:09 FerLuisxd

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);

ngdevelop-tech avatar Sep 08 '19 11:09 ngdevelop-tech

Any update on this?

salgadoguiller avatar Sep 14 '19 17:09 salgadoguiller

any updates ? , it should work on windows, @ngdevelop-tech has it right

ericsoucy avatar Sep 20 '19 02:09 ericsoucy

Ive just deployed with ng deploy, which doesnt work form me before. rewriting utils.js an buider. js like described below helps.

Ondrashisko avatar Sep 26 '19 08:09 Ondrashisko

Same issue here. The best solution currently seems to be avoiding ng deploy for now and just following the normal firebase CLI deploy option.

juanri0s avatar Sep 28 '19 20:09 juanri0s

trying to use this for the 1st time -- same issue 👎

chadbr avatar Oct 01 '19 22:10 chadbr

Same for me, using both:

ng run [ANGULAR_PROJECT_NAME]:deploy

or

ng deploy

Sangarllo avatar Oct 10 '19 20:10 Sangarllo