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

How to install pulsar-client without internet access #289

Open
Roy-Park opened this issue Jan 31, 2023 · 4 comments
Open

How to install pulsar-client without internet access #289

Roy-Park opened this issue Jan 31, 2023 · 4 comments

Comments

@Roy-Park
Copy link

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?

@hrsakai
Copy link
Contributor

hrsakai commented Feb 3, 2023

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

@hrsakai
Copy link
Contributor

hrsakai commented Feb 6, 2023

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

@Roy-Park
Copy link
Author

Roy-Park commented Feb 7, 2023

@hrsakai
It works well with a mirror that is our internal site.
Thank you for help.

By the way, can I pass the user and password for a mirror site?

@hrsakai
Copy link
Contributor

hrsakai commented Feb 9, 2023

@Roy-Park
As far as I've checked the node-pre-gyp code, it doesn't appear to be possible.

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