cannot find module /srv/server.js - gcloud app engine

Better late than never.

The error is coming up because you are loading the relative path.

Solution:

"scripts": {
    "start": "node ./app.js"
},

Check your package.json, you should have at least:

"main": "app.js"

where app.js is your node-file which starts the server.

You could also add:

"scripts": {
    "start": "node app.js"
},

and run "yarn start" to test that your server starts ok.


I solved the problem by putting the App Engine deployment file in the project home:

Home path nodejs project