简体   繁体   中英

deploy to google cloud platform flex env does not include directories?

AFAIK when using the google cloud sdk shell to deploy to the google cloud platform flex environment the deploy does not include the directories. For example, I'm following this nodejs express tutorial - https://cloud.google.com/nodejs/resources/frameworks/express . I can run the app locally. I deploy using gcloud app deploy running it in the same directory as app.yaml. However, after the deployment I get an application startup error:

node ./bin/www:
module.js:471`
    throw err;

Error: Cannot find module '/app/bin/www'

I am able to deploy and run the hello world nodejs tutorial app, but that app has no sub-directories. However, if I modify that app to use EJS and put .ejs files in a 'views' folder and then deploy, the deploy works but the views folder is missing! I've verified that it is missing by using 'fs' in app.js to print out the files and directories of the current folder and guess what - NO directories except the node_modules folder which gets created during the deployment.

I've also tried deploying a python flask app that seems to have the same error (basically it cannot find a template because the templates folder does not exist...).

Has anyone else experienced this? Do I need to do something special in the deploy? I'm very surprised that not even Google's own sample tutorial app does not deploy.

Thanks!

I spent my whole day on the same issue. It looks like it was a problem with the new gcloud sdk shell. You can downgrade your version by 'gcloud components update --version=137.0.1' It workes for me

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM