简体   繁体   中英

could not find module workspace/server.js

I am trying to launch a gcloud app engine using an example in fast-ai with a model that i developped https://github.com/imiled/google-app-engine and followed the instructions in the fastai web page https://course.fast.ai/deployment_google_app_engine.html

but it does not seem to work it raises the following error when i go to the page:

Error: Server Error The server encountered an error and could not complete your request. Please try again in 30 seconds.

here is the log that i got from the console:

miledismael@cloudshell:~/google-app-engine (classification-276710)$ gcloud app browse
Did not detect your browser. Go to this link to view your app:
https://classification-276710.ew.r.appspot.com
miledismael@cloudshell:~/google-app-engine (classification-276710)$ gcloud app logs tail -s default
Waiting for new log entries...
2020-05-11 22:16:26 default[20200512t001309]  "GET / HTTP/1.1" 500
2020-05-11 22:16:28 default[20200512t001309]  internal/modules/cjs/loader.js:983
2020-05-11 22:16:28 default[20200512t001309]    throw err;
2020-05-11 22:16:28 default[20200512t001309]    ^
2020-05-11 22:16:28 default[20200512t001309]
2020-05-11 22:16:28 default[20200512t001309]  Error: Cannot find module '/workspace/server.js'      at Funct
ion.Module._resolveFilename (internal/modules/cjs/loader.js:980:15)      at Function.Module._load (internal/
modules/cjs/loader.js:862:27)      at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main
.js:74:12)      at internal/main/run_main_module.js:18:47 {
2020-05-11 22:16:28 default[20200512t001309]    code: 'MODULE_NOT_FOUND',
2020-05-11 22:16:28 default[20200512t001309]    requireStack: []
2020-05-11 22:16:28 default[20200512t001309]  }

If anybody could help that would be great thanks

There are 2 problems with your app right now:

  • It does not have all the correct requirements described on requirements.txt installed, try installing it again by running cat requirements.txt | xargs npm install -g cat requirements.txt | xargs npm install -g

  • As per your mention on the comments, your app needs more resources in the container it's running on, so you should add that to your app.yaml configuration as described on this documentation

Don't include package-lock.json in the folder. Possibly that's it

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