Using node-canvas in jenkins CI - overriding host to Jenkins-approved host

380 Views Asked by At

How can I override binary-host in node-canvas package.json so it fetches pre-built binariy tarballs from my Jenkins-allowlisted corp server instead of GitHub?

  "binary": {
    "module_name": "canvas",
    "module_path": "build/Release",
    "host": "https://github.com/Automattic/node-canvas/releases/download/",
    "remote_path": "v{version}",
    "package_name": "{module_name}-v{version}-{node_abi}-{platform}-{libc}-{arch}.tar.gz"
  },

Otherwise it goes to GitHub.com and errors our since GitHub is not permitted.

1

There are 1 best solutions below

0
On

npm install canvas --canvas_binary_host_mirror="https://www.makarovcomedy.com" Works, but it doesn't work in yarn.

This works for all: npm config set canvas_binary_host_mirror https://www.makarovcomedy.com

Source: https://github.com/mapbox/node-pre-gyp/pull/170/files