1

I am trying to deploy my react app to GAE, I use cloud build At the end I am receiving this error:

ERROR: (gcloud.app.deploy) Error Response: [9] Cloud build 8a36fcd1-285e-49bc-a13f-b6aef9ae5c8f status: FAILURE
npm ERR! bindings not accessible from watchpack-chokidar2:fsevents

this is my app.yaml:

runtime: nodejs14
service: ***********
basic_scaling:
  max_instances: 10 
  idle_timeout: 5m
resources:
  cpu: 1
  memory_gb: 0.5
  disk_size_gb: 10
handlers: 
- url: /.*
  script: auto
  secure: always
  redirect_http_response_code: 301

this is the cloudBuild.yaml

    steps:
- name: node
  entrypoint: npm
  args: ['install']
- name: node
  entrypoint: npm
  args: ['run','build']
- name: 'gcr.io/cloud-builders/gcloud'
  args: ['app', 'deploy']
  timeout: 1200s
timeout: 1200s
Ron Portnoy
  • 43
  • 1
  • 4
  • Hi, as you can see that this is an npm error, you can go through this question on [stackoverflow](https://stackoverflow.com/questions/68107750/heroku-nodejs-react-error-deploying-app) which is similar to yours, I think the comment that tells that “npm 7 package-lock.js is unreadable by npm6 CI” might help you. Also does your app run fine locally? – Zeenath S N Oct 17 '21 at 11:18

1 Answers1

0

Please review your Jason file over the Script part:

"scripts": { "start": "node server",*****Here should be also include the entry point, where this server is pointing.

I suggest to update this value with something like:

"scripts": { "start": "react-scripts start",*** adding this value , we were able to replicate your case without any issue.

I also recommend to review this documents to get more details about and be able to compare your settings with the ones inside on this documentation:

app-engine-react-demo[1]

package.json[2]

You can take a look to this example :

Deploying a React App to Google’s App Engine[3]

See next stackoverflow post which also mentioned similar cases:

app-engine[4]

And finally review this document where first you need to run npm build command in order to upload the files and then run the deploy.

setup.sh[5]

[1]https://github.com/mikesparr/app-engine-react-demo

[2]https://github.com/mikesparr/app-engine-react-demo/blob/master/package.json

[3]https://blog.doit-intl.com/deploying-a-react-app-to-googles-app-engine-6efa8f4732c7

[4]Deploy create-react-app on Google App Engine

[5]https://github.com/mikesparr/app-engine-react-demo/blob/master/setup.sh

Alva Santi
  • 75
  • 5