Search code examples
swiftlinuxubuntu-20.04vapor

Vapor 4 - Unable to build hello world on fresh install


I've used Vapor 3, but this is my first time with version 4. I'm setting up a fresh server environment with Ubuntu 20.04 and Swift 5.6.1. I can create a new Swift project, build, and run it just fine without issue.

Next I follow along with Vapor's Install and Getting Started docs. I'm able to install Vapor Toolbox just fine. Then to test I work along with the docs and run:

vapor new hello -n
cd hello
swift run

At first it seems to be working fine, grabbing dependencies:

....
Creating working copy for https://github.com/vapor/async-kit.git
Working copy of https://github.com/vapor/async-kit.git resolved at 1.12.0
Creating working copy for https://github.com/apple/swift-nio-extras.git
Working copy of https://github.com/apple/swift-nio-extras.git resolved at 1.12.0
Building for debugging...
[1605/1613] Wrapping AST for Backtrace for debugging

At that point it exits without an error message or anything.

If I run again it's similar situation. Eventually it spits out an error:

error: emit-module command failed due to signal 9 (use -v to see invocation)

Running verbose spits out a huge and unreadable string of paths and commands.

EDIT: Here's a paste of the verbose output since it's too long to include


Solution

  • It sounds like you're running out of memory. Try enabling swap or giving the machine more RAM and try again