0
votes

I have downloaded Expressjs sample application from the repository https://github.com/GoogleCloudPlatform/nodejs-docs-samples/tree/master/appengine/express

then deployed using

gcloud app deploy

Process continued and after some time it is giving below error

Updating service [default]...failed.
ERROR: (gcloud.app.deploy) Error Response: [9]
Application startup error:

> [email protected] start /app
> node ./bin/www

module.js:471
    throw err;
    ^

Error: Cannot find module '/app/bin/www'
    at Function.Module._resolveFilename (module.js:469:15)
    at Function.Module._load (module.js:417:25)
    at Module.runMain (module.js:604:10)
    at run (bootstrap_node.js:394:7)
    at startup (bootstrap_node.js:149:9)
    at bootstrap_node.js:509:3

npm ERR! Linux 3.16.0-4-amd64
npm ERR! argv "/nodejs/bin/node" "/nodejs/bin/npm" "start"
npm ERR! node v6.9.2
npm ERR! npm  v3.10.9
npm ERR! code ELIFECYCLE
npm ERR! [email protected] start: `node ./bin/www`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script 'node ./bin/www'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the appengine-express package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node ./bin/www
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs appengine-express
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls appengine-express
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /app/npm-debug.log

I am able to see a version created in app engine dashboard but failing to start application.

I tried to deploy other sample from the same repo https://github.com/GoogleCloudPlatform/nodejs-docs-samples/tree/master/appengine/hello-world everything works fine.

What I observe from two samples is when node tries to import file from parent folder like below it is failing to start

.....
const app = require('../app');
.....

What is the issue here and am I missing anything?

1
I tried to replicate the error, but everything worked fine for me. I followed the step-by-step in cloud.google.com/nodejs/resources/frameworks/express#expressjs - Nilo_DS
I also followed the same process many times but of no use. I think someone also has the same issue stackoverflow.com/questions/41178056/… - Ashok
Were you able to run it locally? - Nilo_DS
Yes I able to run locally. I tried deploying to AppEngine with fresh account. Issue is same. Hello world sample is running without any issues but express sample failing to start node. - Ashok
@Nilo_DS, what is your gcloud sdk version? Mine is 138.0.0. - Ashok

1 Answers

0
votes

There was a bug in the Google Cloud SDK that has since been fixed where some source folders were not being properly uploaded during deployment.

https://code.google.com/p/google-cloud-sdk/issues/detail?id=1431