Repository navigation
Closed
Description
[REQUIRED] Environment info
firebase-tools:
Firebase CLI Version: 12.4.6
Platform:
Ubuntu
[REQUIRED] Test case
firebase deploy --only hosting
.firebaserc:
{
"projects": {
"default": "county-collector"
},
"targets": {},
"etags": {}
}
firebase.json:
{
"hosting": {
"source": ".",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"frameworksBackend": {
"region": "us-central1"
}
}
}
Outputs:
Error: Could not find the ng executable.
[REQUIRED] Steps to reproduce
npm install @angular/cli: Note that ng executable path fromwhich ngis/usr/local/bin/ng- Install Firebase CLI
firebase deploy --only hosting
[REQUIRED] Expected behavior
Correctly deploys angular app or describes documentation to change ng path.
[REQUIRED] Actual behavior
Fails to find ng executable.
[2023-07-26T15:09:51.656Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
[2023-07-26T15:09:51.657Z] > authorizing via signed-in user (<EMAIL>)
[2023-07-26T15:09:51.657Z] [iam] checking project county-collector for permissions ["firebase.projects.get","firebasehosting.sites.update"]
[2023-07-26T15:09:51.659Z] >>> [apiv2][query] POST https://cloudresourcemanager.googleapis.com/v1/projects/<PROJECT-NAME>:testIamPermissions [none]
[2023-07-26T15:09:51.662Z] >>> [apiv2][(partial)header] POST https://cloudresourcemanager.googleapis.com/v1/projects/<PROJECT-NAME>:testIamPermissions x-goog-quota-user=projects/county-collector
[2023-07-26T15:09:51.663Z] >>> [apiv2][body] POST https://cloudresourcemanager.googleapis.com/v1/projects/<PROJECT-NAME>:testIamPermissions {"permissions":["firebase.projects.get","firebasehosting.sites.update"]}
[2023-07-26T15:09:51.798Z] <<< [apiv2][status] POST https://cloudresourcemanager.googleapis.com/v1/projects/<PROJECT-NAME>:testIamPermissions 200
[2023-07-26T15:09:51.798Z] <<< [apiv2][body] POST https://cloudresourcemanager.googleapis.com/v1/projects/<PROJECT-NAME>:testIamPermissions {"permissions":["firebase.projects.get","firebasehosting.sites.update"]}
[2023-07-26T15:09:51.799Z] >>> [apiv2][query] GET https://firebase.googleapis.com/v1beta1/projects/<PROJECT-NAME> [none]
[2023-07-26T15:09:52.061Z] <<< [apiv2][status] GET https://firebase.googleapis.com/v1beta1/projects/<PROJECT-NAME> 200
[2023-07-26T15:09:52.061Z] <<< [apiv2][body] GET https://firebase.googleapis.com/v1beta1/projects/<PROJECT-NAME> {"projectId":"<PROJECT-NAME>","projectNumber":"<PROJECT-NUMBER>","displayName":"<PROJECT-NAME>","name":"projects/<PROJECT-NAME>","resources":{"hostingSite":"<PROJECT-NAME>","storageBucket":"<PROJECT-NAME>.appspot.com","locationId":"us-central"},"state":"ACTIVE","etag":"1_ed644d71-71cc-47e7-a03a-f03620977b42"}
Thank you for trying our early preview of Angular support on Firebase Hosting.
During the preview, support is best-effort and breaking changes can be expected. Proceed with caution.
Documentation: https://firebase.google.com/docs/hosting/frameworks/angular
File a bug: https://github.com/firebase/firebase-tools/issues/new?template=bug_report.md
Submit a feature request: https://github.com/firebase/firebase-tools/issues/new?template=feature_request.md
We'd love to learn from you. Express your interest in helping us shape the future of Firebase Hosting: https://goo.gle/41enW5X
Error: Could not find the ng executable.
Activity
aalej commentedon Jul 27, 2023
Hi @jwowillo, thanks for reaching out. I’m unable to reproduce the error you mentioned. The steps I took were:
ng new my-appcd my-appfirebase init hosting --project <project_id>firebase deployThere’s a couple of things I’d like to ask to get a better overview of what might be causing this:
firebase emulators:start, or does it run without any issues?npm iornpm installthen re-deploying viafirebase deployproduce a different behavior?node_modulesdirectory, do you see a./bin/ngfile?jwowillo commentedon Jul 27, 2023
I encounter the exact same issue.
No, it doesn't produce a different behavior.
The path in node_modules is: node_modules/@angular/cli/bin/ng.js. My angular CLI version is 16.1.4.
CarlosFlores24 commentedon Aug 4, 2023
Any updates on this? I have same issue as OP under similar conditions:
ENVIRONMENT INFO
-Firebase CLI V12.4.7
-Angular CLI V16.1.6
-npm: 9.8.0
-node.js: 18.16.1
-Platform: Windows10
TEST CASE
.firebaserc
firebase.json
STEPS TO REPRODUCE
(Same as above)
EXPECTED BEHAVIOUR
Correctly deploys angular app or describes documentation to change ng path.
ACTUAL BEHAVIOUR
Additionally,
firebase emulators:startdoesn't work form me either. Also, theng.jsfile does exist insidenode_modules/bin/. I also ran npm install and the problem is still unsolved.DiegoVenancioVieira commentedon Sep 24, 2023
Two situations that it happened with me:
1 - Detected an existing Angular codebase in the current directory, should we use this?
2 - Do you want to use a web framework? (experimental) ?
both situations if YES error occurs. Then NO and works fine.
AgustinFrich commentedon Oct 12, 2023
This worked for me, the error is gone
leoortizz commentedon Nov 29, 2023
Looks like this is the same issue that was fixed in #6372, which was released in v12.6.0. Can you all check the latest firebase-tools version?
leoortizz commentedon Dec 4, 2023
Fixed by #6372