Trying to run 'npm install' through GitLab CI results in error

This is our .gitlab-ci.yml:

stages:
  - deploy

deploy_staging:
  stage: deploy
  image: chrben/ubuntu-npm-nonroot:latest
  before_script:
    - npm install --no-progress
  script:
    - gulp build
  only:
    - develop

It is using a docker image I put up myself, it is basically ubuntu:latest with node/npm and basic dependencies installed. Gulp is installed with the -g flag as well.

When committing to the develop branch, the job ends with this output:

Running with gitlab-runner 11.5.1 (7f00c780)
on runner1 bd318f2f
Using Docker executor with image chrben/ubuntu-npm-nonroot:latest ...
Pulling docker image chrben/ubuntu-npm-nonroot:latest ...
Using docker image sha256:8e9d60ba5b9e4ea1344ceabfd9fdf4a1fb8fcd795c034ac0a530a6f1a1070ba8 for chrben/ubuntu-npm-nonroot:latest ...
Running on runner-bd318f2f-project-2-concurrent-0 via runner1...
Fetching changes...
Removing node_modules/
HEAD is now at 6e6e169 Update .gitlab-ci.yml, trying gulp process once more
From xxxx
6e6e169..22bbb90 develop -> origin/develop
Checking out 22bbb907 as develop...
Skipping Git submodules setup
$ npm install --no-progress

> node-sass@4.11.0 install /builds/mesor-dev/bilservice/node_modules/node-sass
> node scripts/install.js

ERROR: Job failed: exit code 1

I have tried installing gitlab-runner on my local machine and running the job locally, and it completes without errors, so I am at a loss as to why it isn’t working via gitlab.

This is the config.toml file from the runner:

concurrent = 1
check_interval = 0

[session_server]
  session_timeout = 1800

[[runners]]
  name = "runner1"
  url = "xxxx"
  token = "xxxx"
  executor = "docker"
  [runners.docker]
    tls_verify = false
    image = "ubuntu:latest"
    privileged = false
    disable_entrypoint_overwrite = false
    oom_kill_disable = false
    disable_cache = false
    volumes = ["/cache"]
    shm_size = 0
    pull_policy = "if-not-present"
  [runners.cache]
    [runners.cache.s3]
    [runners.cache.gcs]

I have tried running the job with debug tracing enabled, but this resulted in no further elaboration on the error message. I can include this log if necessary, however.

I initially thought this resulted from npm install being executed as root, but i created a new docker image specifically to bypass this, and execute everything as a normal user, to no avail.

Any input would be much appreciated!

I set up my local machine as a runner for our gitlab repository, and the jobs ran fine. It seems like the problem is either in the gitlab-runner version on our other runner, or it might run out of available memory during the job, as it only has 512MiB available in total.
How much memory is recommended for running npm jobs?