Cannot build node on Raspberry PI

I am trying to build a dockerfile on my Raspberry Pi 4, running arm64 Ubuntu. The same dockerfile runs fine on my main computer. The dockerfile is as follows:

FROM node:12 as builder

WORKDIR /app

COPY .client/package.json .
COPY .package-lock.json .
RUN npm install
...

Upon building this file I get the following error:

Sending build context to Docker daemon  29.35MB
Step 1/12 : FROM node:12 as builder
 ---> 70b24a2d7b95
Step 2/12 : WORKDIR /app
 ---> Using cache
 ---> 2ab48332f35b
Step 3/12 : COPY .client/package.json .
 ---> Using cache
 ---> d7009f4cfa0b
Step 4/12 : COPY .client/package-lock.json .
 ---> Using cache
 ---> 59d4f21519ed
Step 5/12 : RUN npm install
 ---> Running in 84f62d84dcbe
Aborted (core dumped)
The command '/bin/sh -c npm install' returned a non-zero code: 134

The error code of 134 refers to running out of memory on the host, but I have checked both memory and storage and there seems to be plenty of space left. What could be the issue? Thank you!