How to install pulsar-client without internet access
Roy-Park opened this issue · 4 comments
There is a limitation in my build system to access the internet.
We use the private proxy repository (JFrog) in intranet instead of the public npm repository.
I got the error when I try to install the pulsar-client@1.8.0 package.
Because it tries to get the C++ library from the internet.(https://dist.apache.org/repos/dist/release/pulsar/pulsar-client-node/)
Is there any way to configure this URL as a my own or local path?
You can download a binary file through a mirror instead of https://dist.apache.org/repos/dist/release/pulsar/pulsar-client-node/ by setting npm_config_Pulsar_binary_host_mirror
.
# node-pre-gyp fetches <mirror url>/pulsar-client-node-{version}/napi-{platform}-{libc}-{arch}.tar.gz
$ env npm_config_Pulsar_binary_host_mirror=<mirror url> npm install pulsar-client
If you want to fetch a binary file from local
# node-pre-gyp fetches <path>/pulsar-client-node-{version}/napi-{platform}-{libc}-{arch}.tar.gz
$ env npm_config_Pulsar_binary_host_mirror=file://<path> npm install pulsar-client
Currently, npm config argument cant't be used because module_name of pulsar-client include uppercase letter.
https://github.com/apache/pulsar-client-node/blob/v1.8.0/package.json#L60
"binary": {
"module_name": "Pulsar",
npm will use npm_config_pulsar_binary_host_mirror for the environment variable name even if running npm install pulsar-client --Pulsar_binary_host_mirror=<mirror url>
.
https://github.com/mapbox/node-pre-gyp#download-binary-files-from-a-mirror
I created a PR with the module_name renamed from Pulsar to pulsar.
#290
From a version containing the PR above, please run npm install
like followings:
$ npm install pulsar-client --pulsar_binary_host_mirror=<mirror url>
or
$ env npm_config_pulsar_binary_host_mirror=file://<path> npm install pulsar-client