Skip to content
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

Error runnig ng add @angular/fire: "ENOENT: no such file or directory, open 'firebase.json'" #3016

Closed
alisterlf opened this issue Oct 12, 2021 · 5 comments · Fixed by #3022
Closed

Comments

@alisterlf
Copy link

Version info

Angular: 12.2.9

Firebase: 9.20.0

AngularFire: 7.1.0

Node: 16.8.0

npm: 8.0.0

How to reproduce these conditions

Steps to set up and reproduce

ng new angular-ssr-firebase --routing --style scss
cd .\angular-ssr-firebase\
ng add @angular/fire

Debug output

** Output from terminal **

PS C:\Users\alist\Git> ng new angular-ssr-firebase --routing --style scss
CREATE angular-ssr-firebase/angular.json (3291 bytes)
CREATE angular-ssr-firebase/package.json (1082 bytes)
CREATE angular-ssr-firebase/README.md (1064 bytes)
CREATE angular-ssr-firebase/tsconfig.json (783 bytes)
CREATE angular-ssr-firebase/.editorconfig (274 bytes)
CREATE angular-ssr-firebase/.gitignore (604 bytes)
CREATE angular-ssr-firebase/.browserslistrc (703 bytes)
CREATE angular-ssr-firebase/karma.conf.js (1437 bytes)
CREATE angular-ssr-firebase/tsconfig.app.json (287 bytes)
CREATE angular-ssr-firebase/tsconfig.spec.json (333 bytes)
CREATE angular-ssr-firebase/src/favicon.ico (948 bytes)
CREATE angular-ssr-firebase/src/index.html (304 bytes)
CREATE angular-ssr-firebase/src/main.ts (372 bytes)
CREATE angular-ssr-firebase/src/polyfills.ts (2820 bytes)
CREATE angular-ssr-firebase/src/styles.scss (80 bytes)
CREATE angular-ssr-firebase/src/test.ts (788 bytes)
CREATE angular-ssr-firebase/src/assets/.gitkeep (0 bytes)
CREATE angular-ssr-firebase/src/environments/environment.prod.ts (51 bytes)
CREATE angular-ssr-firebase/src/environments/environment.ts (658 bytes)
CREATE angular-ssr-firebase/src/app/app-routing.module.ts (245 bytes)
CREATE angular-ssr-firebase/src/app/app.module.ts (393 bytes)
CREATE angular-ssr-firebase/src/app/app.component.html (24617 bytes)
CREATE angular-ssr-firebase/src/app/app.component.spec.ts (1115 bytes)
CREATE angular-ssr-firebase/src/app/app.component.ts (225 bytes)
CREATE angular-ssr-firebase/src/app/app.component.scss (0 bytes)
✔ Packages installed successfully.
    Successfully initialized git.
PS C:\Users\alist\Git> cd .\angular-ssr-firebase\
PS C:\Users\alist\Git\angular-ssr-firebase> ng add @angular/fire
ℹ Using package manager: npm
✔ Found compatible package version: @angular/fire@7.1.0.
✔ Package information loaded.

The package @angular/fire@7.1.0 will be installed and executed.
Would you like to proceed? Yes
✔ Package successfully installed.
UPDATE package.json (1162 bytes)
✔ Packages installed successfully.
? What features would you like to setup? ng deploy -- hosting
Using firebase-tools version 9.20.0
ENOENT: no such file or directory, open '\C\Users\alist\Git\angular-ssr-firebase\firebase.json'

** Screenshots **
image

Expected behavior

Schematics running successfully

Actual behavior

Error creating firebase.json file.

@jamesdaniels
Copy link
Member

Ah windows, I bet that has something to do with it. Should help me narrow down the problem, thanks.

@alisterlf
Copy link
Author

I don't know if helps, but i'm using Windows 11

@jamesdaniels
Copy link
Member

jamesdaniels commented Oct 12, 2021

There’s been a flaky test in the windows contribute test suite, which means I haven’t been keeping as good an eye on this as I should. I’ll see if I can repro on my gaming machine. expect I’ll be able to track it down quickly.

@alisterlf
Copy link
Author

I just confirmed it is a problem in Windows.
I execute the same instructions on Ubuntu 18 in Windows Subsystem for Linux (WSL), and the script finish successfully.

@alisterlf
Copy link
Author

alisterlf commented Oct 12, 2021

I'm not sure if it's a related issue, but after i successfully installed angular fire and deployed on firebase functions using Ubuntu. I tried deploy using Windows, but i receive an error.

On Ubuntu
image

On Windows
image

Error log on Firebase

{
  "@type": "type.googleapis.com/google.cloud.audit.AuditLog",
  "status": {
    "code": 3,
    "message": "Build failed: npm ERR! The `npm ci` command can only install with an existing package-lock.json or\nnpm ERR! npm-shrinkwrap.json with lockfileVersion >= 1. Run an install with npm@5 or\nnpm ERR! later to generate a package-lock.json file, then try again.\n\nnpm ERR! A complete log of this run can be found in:\nnpm ERR!     /www-data-home/.npm/_logs/2021-10-12T16_18_43_488Z-debug.log; Error ID: beaf8772"
  },
  "authenticationInfo": { "principalEmail": "alisterlf@gmail.com" },
  "serviceName": "cloudfunctions.googleapis.com",
  "methodName": "google.cloud.functions.v1.CloudFunctionsService.UpdateFunction",
  "resourceName": "projects/hefesto-ecommerce/locations/southamerica-east1/functions/ssr_StoreWebApp"
}

jamesdaniels added a commit that referenced this issue Oct 14, 2021
Need to convert the schematic host path to a windows path. Fixes #3016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants