angular - Firebase App Hosting : sh: 1: ng: not found - Stack Overflow

EnvironmentAngular 19.2.0 Angular workspace mono-repo with 4 Angular projectsinsideUsing IonicUsing

Environment

  • Angular 19.2.0 Angular workspace mono-repo with 4 Angular projects inside
  • Using Ionic
  • Using SSR for two projects
  • Attempting to deploy a project named "anizer" (using SSR) from my Angular workspace (and then the others)
  • I want to use Firebase App Hosting (different from Firebase Hosting).
  • I have followed the official documentation link.

My Angular workspace has a main package.json. All my projects have their own package.json.

Inside the package.json of the "anizer" project, I have the following scripts:

"scripts": {
  "start": "ionic serve",
  "build": "ng build"
},

When I commit my modifications to the main branch, a Firebase App Hosting deployment is triggered. When I go to "View Cloud Build logs," I see this log error:

Installing application dependencies.
--------------------------------------------------------------------------------
Running "npm ci --quiet --no-fund --no-audit (NODE_ENV=development)"
added 4 packages in 756ms
Done "npm ci --quiet --no-fund --no-audit (NODE_ENV=development)" (858.107321ms)
--------------------------------------------------------------------------------
Running "npm run build"
> [email protected] build
> ng build
sh: 1: ng: not found
Done "npm run build" (192.475112ms)
--------------------------------------------------------------------------------
failed to build: (error ID: 1a2262f3):
> [email protected] build
> ng build
sh: 1: ng: not found
NOTE: Running the default build script can be skipped by passing the empty environment variable "GOOGLE_NODE_RUN_SCRIPTS=" to the build
ERROR: failed to build: exit status 1
ERROR: failed to build: executing lifecycle: failed with status code: 51

EDIT : I have tried to update the package.json script with

"build": "npx ng build"

The log error is now :

Running "npm run build"
> [email protected] build
> npx ng build
npm error could not determine executable to run
npm error A complete log of this run can be found in: /home/cnb/.npm/_logs/2025-03-12T12_06_36_944Z-debug-0.log
Done "npm run build" (896.994704ms)
--------------------------------------------------------------------------------
failed to build: (error ID: 1a2262f3):
> [email protected] build
> npx ng build
npm error could not determine executable to run

I also tried npx run build and npx ng build without success (same error log).

I don't know what to do and I don't find many resources on the subject.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744755967a4591883.html

相关推荐

  • angular - Firebase App Hosting : sh: 1: ng: not found - Stack Overflow

    EnvironmentAngular 19.2.0 Angular workspace mono-repo with 4 Angular projectsinsideUsing IonicUsing

    6小时前
    50

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信