stevenliuyi / covid19

an interactive, animated COVID-19 coronavirus map to track the outbreak over time by country and by region for selected countries
MIT License
325 stars 97 forks source link

How to host this on AWS? #39

Open abhiklodh opened 4 years ago

abhiklodh commented 4 years ago

As the title suggests, I tried hosting the website on my EC2 instance. I tried following one specific hosting guide on macOS in this repo but that didn't seem to help things. I ran into a few issues.

yarn —-recursive yarn run v1.22.4 error Command "—-recursive" not found. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. and then `yarn install yarn install v1.22.4 [1/4] Resolving packages... [2/4] Fetching packages... info fsevents@2.1.2: The platform "linux" is incompatible with this module. info "fsevents@2.1.2" is an optional dependency and failed compatibility check. Excluding it from installation. info fsevents@2.1.2: The engine "node" is incompatible with this module. Expected version "^8.16.0 || ^10.6.0 || >=11.0.0". Got "8.10.0" info fsevents@1.2.11: The platform "linux" is incompatible with this module. info "fsevents@1.2.11" is an optional dependency and failed compatibility check. Excluding it from installation. [3/4] Linking dependencies... warning " > @nivo/bump@0.61.1" has unmet peer dependency "prop-types@>= 15.5.10 < 16.0.0". warning "@nivo/bump > @nivo/colors@0.61.0" has unmet peer dependency "prop-types@>= 15.5.10 < 16.0.0". warning "@nivo/bump > @nivo/core@0.61.0" has unmet peer dependency "prop-types@>= 15.5.10 < 16.0.0". warning "@nivo/bump > @nivo/legends@0.61.1" has unmet peer dependency "prop-types@>= 15.5.10 < 16.0.0". warning "@nivo/bump > @nivo/tooltip@0.61.0" has unmet peer dependency "prop-types@>= 15.5.10 < 16.0.0". warning " > @nivo/circle-packing@0.61.0" has unmet peer dependency "prop-types@>= 15.5.10 < 16.0.0". warning " > @nivo/line@0.61.1" has unmet peer dependency "prop-types@>= 15.5.10 < 16.0.0". warning "@nivo/line > @nivo/annotations@0.61.0" has unmet peer dependency "prop-types@>= 15.5.10 < 16.0.0". warning "@nivo/line > @nivo/axes@0.61.0" has unmet peer dependency "prop-types@>= 15.5.10 < 16.0.0". warning "@nivo/line > @nivo/scales@0.61.0" has unmet peer dependency "prop-types@>= 15.5.10 < 16.0.0". warning "@nivo/line > @nivo/voronoi@0.61.0" has unmet peer dependency "prop-types@>= 15.5.10 < 16.0.0". warning " > @nivo/stream@0.61.1" has unmet peer dependency "prop-types@>= 15.5.10 < 16.0.0". warning " > bootstrap@4.4.1" has unmet peer dependency "jquery@1.9.1 - 3". warning " > bootstrap@4.4.1" has unmet peer dependency "popper.js@^1.16.0". warning "react-scripts > eslint-config-react-app@5.2.0" has incorrect peer dependency "eslint-plugin-flowtype@3.x". warning "react-scripts > @typescript-eslint/eslint-plugin > tsutils@3.17.1" has unmet peer dependency "typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta". warning " > react-simple-maps@1.0.0-beta.0" has unmet peer dependency "prop-types@^15.7.2". warning " > react-toggle@4.1.1" has unmet peer dependency "prop-types@^15.3.0 || ^16.0.0". [4/4] Building fresh packages... [-/4] ⡀ waiting... [-/4] ⡀ waiting... [3/4] ⢀ core-js error /home/ubuntu/covid19/node_modules/postinstall-postinstall: Command failed. Exit code: 1 Command: node ./run.js Arguments: Directory: /home/ubuntu/covid19/node_modules/postinstall-postinstall Output: Traceback (most recent call last): File "data/iran-data/crawler.py", line 2, in from bs4 import BeautifulSoup ModuleNotFoundError: No module named 'bs4' error Command failed with exit code 1. child_process.js:644 throw err; ^

Error: Command failed: yarn run postinstall Traceback (most recent call last): File "data/iran-data/crawler.py", line 2, in from bs4 import BeautifulSoup ModuleNotFoundError: No module named 'bs4' error Command failed with exit code 1.

at checkExecSyncError (child_process.js:601:13)
at execSync (child_process.js:641:13)
at Object.<anonymous> (/home/ubuntu/covid19/node_modules/postinstall-postinstall/run.js:14:5)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Function.Module.runMain (module.js:693:10)

` and then

`yarn build yarn run v1.22.4 $ react-app-rewired build Creating an optimized production build...

<--- Last few GCs --->

[21667:0x562905ae41d0] 56211 ms: Scavenge 613.5 (665.7) -> 608.1 (668.7) MB, 12.9 / 0.0 ms allocation failure [21667:0x562905ae41d0] 56286 ms: Scavenge 617.2 (668.7) -> 615.0 (676.7) MB, 56.1 / 3.8 ms allocation failure [21667:0x562905ae41d0] 56694 ms: Scavenge 624.5 (676.7) -> 619.6 (682.7) MB, 77.0 / 4.5 ms allocation failure [21667:0x562905ae41d0] 57300 ms: Scavenge 631.1 (682.7) -> 623.8 (682.7) MB, 459.8 / 3.8 ms allocation failure

<--- JS stacktrace ---> Cannot get stack trace in GC. FATAL ERROR: NewSpace::Rebalance Allocation failed - process out of memory 1: node::Abort() [/usr/bin/node] 2: 0x56290437d011 [/usr/bin/node] 3: v8::Utils::ReportOOMFailure(char const, bool) [/usr/bin/node] 4: v8::internal::V8::FatalProcessOutOfMemory(char const, bool) [/usr/bin/node] 5: v8::internal::MarkCompactCollector::Evacuate() [/usr/bin/node] 6: v8::internal::MarkCompactCollector::CollectGarbage() [/usr/bin/node] 7: v8::internal::Heap::MarkCompact() [/usr/bin/node] 8: v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [/usr/bin/node] 9: v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/usr/bin/node] 10: v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationSpace) [/usr/bin/node] 11: v8::internal::Runtime_AllocateInTargetSpace(int, v8::internal::Object*, v8::internal::Isolate) [/usr/bin/node] 12: 0x2caee39840bd The build failed because the process exited too early. This probably means the system ran out of memory or someone called kill -9 on the process. error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. `