0

Using GCP Cloud Build to run some Mocha integration tests that uses the "@google-cloud/tasks" api. On running the pipeline this step fails with an@grpc/grpc-js only works on Node ^8.13.0 || >=10.10.0 error. The error occurs in the yargs module.

Any suggestions?

cjt
  • 273
  • 4
  • 8

2 Answers2

2

Figured it out. The gcr.io/cloud-builders/npm container image still (2019-07-03) points to node 8.12. So when you run build steps that requires nodejs 10 you need to change the container namn in your cloudbuild.yaml file to use the "new" version (i.e. the one with nodejs 10). Go to your container images library and get the name, then just update the name in .yaml. In my case it looked like,

  • name: "gcr.io/cloud-builders/npm@sha256:63d3104767b......" args: ["run", "test"]
cjt
  • 273
  • 4
  • 8
1

You can also use the official node image:

steps:
- name: node:10.16.0
  entrypoint: npm
  args: ['run', 'test']
Arthur BP
  • 11
  • 1
  • 1