Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It seems pre-built binary downloading does not follow proxy environment variables #2419

Open
1 task done
marjune163 opened this issue Aug 21, 2024 · 1 comment
Open
1 task done

Comments

@marjune163
Copy link

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 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.

Steps to Reproduce

$ https_proxy=XXXXXXXXXXXX npm install --verbose
npm verbose cli /usr/local/bin/node /usr/local/bin/npm
npm info using [email protected]
npm info using [email protected]
npm verbose title npm install
npm verbose argv "install" "--loglevel" "verbose"
npm verbose logfile logs-max:10 dir:/home/myname/.npm/_logs/2024-08-21T12_48_40_765Z-
npm verbose logfile /home/myname/.npm/_logs/2024-08-21T12_48_40_765Z-debug-0.log
npm verbose reify failed optional dependency /work/myproject/node_modules/playwright/node_modules/fsevents
npm verbose reify failed optional dependency /work/myproject/node_modules/fsevents
npm verbose reify failed optional dependency /work/myproject/node_modules/@swc/core-win32-x64-msvc
npm verbose reify failed optional dependency /work/myproject/node_modules/@swc/core-win32-ia32-msvc
npm verbose reify failed optional dependency /work/myproject/node_modules/@swc/core-win32-arm64-msvc
npm verbose reify failed optional dependency /work/myproject/node_modules/@swc/core-linux-arm64-musl
npm verbose reify failed optional dependency /work/myproject/node_modules/@swc/core-linux-arm64-gnu
npm verbose reify failed optional dependency /work/myproject/node_modules/@swc/core-linux-arm-gnueabihf
npm verbose reify failed optional dependency /work/myproject/node_modules/@swc/core-darwin-x64
npm verbose reify failed optional dependency /work/myproject/node_modules/@swc/core-darwin-arm64
npm verbose reify failed optional dependency /work/myproject/node_modules/@esbuild/win32-x64
npm verbose reify failed optional dependency /work/myproject/node_modules/@esbuild/win32-ia32
npm verbose reify failed optional dependency /work/myproject/node_modules/@esbuild/win32-arm64
npm verbose reify failed optional dependency /work/myproject/node_modules/@esbuild/sunos-x64
npm verbose reify failed optional dependency /work/myproject/node_modules/@esbuild/openbsd-x64
npm verbose reify failed optional dependency /work/myproject/node_modules/@esbuild/netbsd-x64
npm verbose reify failed optional dependency /work/myproject/node_modules/@esbuild/linux-s390x
npm verbose reify failed optional dependency /work/myproject/node_modules/@esbuild/linux-riscv64
npm verbose reify failed optional dependency /work/myproject/node_modules/@esbuild/linux-ppc64
npm verbose reify failed optional dependency /work/myproject/node_modules/@esbuild/linux-mips64el
npm verbose reify failed optional dependency /work/myproject/node_modules/@esbuild/linux-loong64
npm verbose reify failed optional dependency /work/myproject/node_modules/@esbuild/linux-ia32
npm verbose reify failed optional dependency /work/myproject/node_modules/@esbuild/linux-arm64
npm verbose reify failed optional dependency /work/myproject/node_modules/@esbuild/linux-arm
npm verbose reify failed optional dependency /work/myproject/node_modules/@esbuild/freebsd-x64
npm verbose reify failed optional dependency /work/myproject/node_modules/@esbuild/freebsd-arm64
npm verbose reify failed optional dependency /work/myproject/node_modules/@esbuild/darwin-x64
npm verbose reify failed optional dependency /work/myproject/node_modules/@esbuild/darwin-arm64
npm verbose reify failed optional dependency /work/myproject/node_modules/@esbuild/android-x64
npm verbose reify failed optional dependency /work/myproject/node_modules/@esbuild/android-arm64
npm verbose reify failed optional dependency /work/myproject/node_modules/@esbuild/android-arm
npm verbose reify failed optional dependency /work/myproject/node_modules/@esbuild/aix-ppc64
npm http fetch POST 200 https://registry.npmjs.org/-/npm/v1/security/advisories/bulk 5711ms
npm warn deprecated [email protected]: This package is no longer supported.
npm warn deprecated [email protected]: This package is no longer supported.
npm http fetch GET 200 https://registry.npmjs.org/ws 6219ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/terser 6335ms (cache revalidated)
npm warn deprecated [email protected]: This package is no longer supported.
npm http fetch GET 200 https://registry.npmjs.org/tar-stream 6444ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/tailwindcss 6541ms (cache revalidated)
...
...
...
npm info run [email protected] install node_modules/canvas node-pre-gyp install --fallback-to-build --update-binary
npm http fetch GET 200 https://registry.npmjs.org/postal.request-response 722ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/css-select 103ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/socket.io-client 111ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/react-scripts 127ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/@storybook%2fcli 312ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/svgo 115ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/react-app-rewired 288ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/@storybook%2fpreset-create-react-app 1586ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/storybook 225ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/@svgr%2fplugin-svgo 145ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/@svgr%2fwebpack 130ms (cache revalidated)

Stucked here. When press Ctrl+C, shows:

npm info run [email protected] 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 [email protected]
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 [email protected]
npm error node-pre-gyp info using [email protected] | 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 [email protected] 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
$ node --version
v20.16.0
$ npm --version
10.8.1
@exige81
Copy link

exige81 commented Oct 19, 2024

You can configure node-pre-gyp to use a mirror that you have access to using the --canvas_binary_host_mirror flag.
See #1771 for some more info

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants