apache / apache/pulsar-client-node

Cannot build the nodejs client following the Readme

Open
#237 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
164
Forks
98
PR merge metrics
No merged PRs in 30d

Description

System: Ubuntu-18.04

When I followed the readme to build the client, it threw following errors at the `npm run build` step:
```
make: Entering directory '/workspaces/pulsar-client-node/build'
SOLINK_MODULE(target) Release/obj.target/Pulsar.node
g++: error: ../pkg/lib/libpulsarwithdeps.a: No such file or directory
make: *** [Pulsar.target.mk:157: Release/obj.target/Pulsar.node] Error 1
make: Leaving directory '/workspaces/pulsar-client-node/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/opt/nodejs/17.6.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack at ChildProcess.emit (node:events:527:28)
gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
gyp ERR! System Linux 5.4.0-1090-azure
gyp ERR! command "/opt/nodejs/17.6.0/bin/node" "/opt/nodejs/17.6.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--module=/workspaces/pulsar-client-node/lib/binding/Pulsar.node" "--module_name=Pulsar" "--module_path=/workspaces/pulsar-client-node/lib/binding" "--napi_version=8" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v102"
gyp ERR! cwd /workspaces/pulsar-client-node
gyp ERR! node -v v17.6.0
gyp ERR! node-gyp -v v8.4.1
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/opt/nodejs/17.6.0/bin/node /opt/nodejs/17.6.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --module=/workspaces/pulsar-client-node/lib/binding/Pulsar.node --module_name=Pulsar --module_path=/workspaces/pulsar-client-node/lib/binding --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v102' (1)
node-pre-gyp ERR! stack at ChildProcess. (/workspaces/pulsar-client-node/node_modules/@mapbox/node-pre-gyp/lib/util/compile.js:89:23)
node-pre-gyp ERR! stack at ChildProcess.emit (node:events:527:28)
node-pre-gyp ERR! stack at maybeClose (node:internal/child_process:1090:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)
node-pre-gyp ERR! System Linux 5.4.0-1090-azure
node-pre-gyp ERR! command "/opt/nodejs/17.6.0/bin/node" "/workspaces/pulsar-client-node/node_modules/.bin/node-pre-gyp" "build"
node-pre-gyp ERR! cwd /workspaces/pulsar-client-node
node-pre-gyp ERR! node -v v17.6.0
node-pre-gyp ERR! node-pre-gyp -v v1.0.9
node-pre-gyp ERR! not ok
```

Cannot find the `libpulsarwithdeps.a`. I found that there is a script to build the `libpulsarwithdeps.a` on the macos system but not for the linux system. I think we may need to update the Readme.

/cc @shibd

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the README instructions for `npm run build` and compare them with the existing macOS script that builds `libpulsarwithdeps.a`. Check how the Linux build should produce that library, then document the required steps; done means the README workflow completes successfully on Ubuntu without the missing-library error.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, linux, nodejs, ubuntu
Domain
build-system, documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.