It seems pre-built binary downloading does not follow proxy environment variables.
I have difficulty accessing npm registry and github directly. When I run npm install, I actually run https_proxy=MY_PROXY_ADDRESS npm install. This works for downloading regular npm package via proxy. But when installing node-canvas, it stucks at downloading prebuilt binary. Seems it always try to connect github directly without proxy.
npm info run canvas@2.11.2 install { code: null, signal: 'SIGINT' }
npm verbose stack Error: command failed
npm verbose stack at promiseSpawn (/usr/local/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/lib/index.js:22:22)
npm verbose stack at spawnWithShell (/usr/local/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/lib/index.js:124:10)
npm verbose stack at promiseSpawn (/usr/local/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/lib/index.js:12:12)
npm verbose stack at runScriptPkg (/usr/local/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/run-script-pkg.js:77:13)
npm verbose stack at runScript (/usr/local/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/run-script.js:9:12)
npm verbose stack at /usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/rebuild.js:329:17
npm verbose stack at run (/usr/local/lib/node_modules/npm/node_modules/promise-call-limit/dist/commonjs/index.js:67:22)
npm verbose stack at /usr/local/lib/node_modules/npm/node_modules/promise-call-limit/dist/commonjs/index.js:84:9
npm verbose stack at new Promise (<anonymous>)
npm verbose stack at callLimit (/usr/local/lib/node_modules/npm/node_modules/promise-call-limit/dist/commonjs/index.js:35:69)
npm verbose pkgid canvas@2.11.2
npm error path /work/myproject/node_modules/canvas
npm error command failed
npm error signal SIGINT
npm error command sh -c node-pre-gyp install --fallback-to-build --update-binary
npm error node-pre-gyp info it worked if it ends with ok
npm error node-pre-gyp verb cli [
npm error node-pre-gyp verb cli '/usr/local/bin/node',
npm error node-pre-gyp verb cli '/work/myproject/node_modules/.bin/node-pre-gyp',
npm error node-pre-gyp verb cli 'install',
npm error node-pre-gyp verb cli '--fallback-to-build',
npm error node-pre-gyp verb cli '--update-binary'
npm error node-pre-gyp verb cli ]
npm error node-pre-gyp info using node-pre-gyp@1.0.11
npm error node-pre-gyp info using node@20.16.0 | linux | x64
npm error node-pre-gyp verb command install []
npm error node-pre-gyp http GET https://github.com/Automattic/node-canvas/releases/download/v2.11.2/canvas-v2.11.2-node-v115-linux-glibc-x64.tar.gz
npm error node-pre-gyp info install unpacking Release/
npm error node-pre-gyp info install unpacking Release/libfontconfig.so.1
npm verbose cwd /work/myproject
npm verbose os Linux 6.1.0-22-amd64
npm verbose node v20.16.0
npm verbose npm v10.8.1
npm verbose exit 1
npm verbose code 1
npm error A complete log of this run can be found in: /home/myname/.npm/_logs/2024-08-21T12_52_58_532Z-debug-0.log
Your Environment
Version of node-canvas (output of npm list canvas or yarn list canvas):
the npm install log says: npm info run canvas@2.11.2 install node_modules/canvas node-pre-gyp install --fallback-to-build --update-binary
Environment (e.g. node 20.9.0 on macOS 14.1.1):
$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 12 (bookworm)
Release: 12
Codename: bookworm
Issue or Feature
It seems pre-built binary downloading does not follow proxy environment variables. I have difficulty accessing npm registry and github directly. When I run
npm install
, I actually runhttps_proxy=MY_PROXY_ADDRESS npm install
. This works for downloading regular npm package via proxy. But when installing node-canvas, it stucks at downloading prebuilt binary. Seems it always try to connect github directly without proxy.Steps to Reproduce
Stucked here. When press
Ctrl
+C
, shows:Your Environment
Version of node-canvas (output of
npm list canvas
oryarn list canvas
): thenpm install
log says:npm info run canvas@2.11.2 install node_modules/canvas node-pre-gyp install --fallback-to-build --update-binary
Environment (e.g. node 20.9.0 on macOS 14.1.1):