pulsar-client-node icon indicating copy to clipboard operation
pulsar-client-node copied to clipboard

mac m1 install pulsar-client

Open Sarmay opened this issue 2 years ago • 2 comments

npm WARN config global --global, --local are deprecated. Use --location=global instead. npm ERR! code 1 npm ERR! path /usr/local/lib/node_modules/pulsar-client npm ERR! command failed npm ERR! command sh -c node-pre-gyp install --fallback-to-build npm ERR! CC(target) Release/obj.target/nothing/node_modules/node-addon-api/nothing.o npm ERR! LIBTOOL-STATIC Release/nothing.a npm ERR! CXX(target) Release/obj.target/Pulsar/src/addon.o npm ERR! CXX(target) Release/obj.target/Pulsar/src/Message.o npm ERR! CXX(target) Release/obj.target/Pulsar/src/MessageId.o npm ERR! CXX(target) Release/obj.target/Pulsar/src/Authentication.o npm ERR! CXX(target) Release/obj.target/Pulsar/src/Client.o npm ERR! CXX(target) Release/obj.target/Pulsar/src/Producer.o npm ERR! CXX(target) Release/obj.target/Pulsar/src/ProducerConfig.o npm ERR! CXX(target) Release/obj.target/Pulsar/src/Consumer.o npm ERR! CXX(target) Release/obj.target/Pulsar/src/ConsumerConfig.o npm ERR! CXX(target) Release/obj.target/Pulsar/src/Reader.o npm ERR! CXX(target) Release/obj.target/Pulsar/src/ReaderConfig.o npm ERR! SOLINK_MODULE(target) Release/Pulsar.node npm ERR! Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/usr/local/lib/node_modules/pulsar-client/build/Release/libpulsar.node --module_name=libpulsar --module_path=/usr/local/lib/node_modules/pulsar-client/build/Release --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v93' (1) npm ERR! node-pre-gyp info it worked if it ends with ok npm ERR! node-pre-gyp info using [email protected] npm ERR! node-pre-gyp info using [email protected] | darwin | arm64 npm ERR! node-pre-gyp info check checked for "/usr/local/lib/node_modules/pulsar-client/build/Release/libpulsar.node" (not found) npm ERR! node-pre-gyp http GET https://pulsar.apache.org/docs/en/client-libraries-cpp/libpulsar-v1.6.2-node-v93-darwin-arm64.tar.gz npm ERR! node-pre-gyp ERR! install response status 404 Not Found on https://pulsar.apache.org/docs/en/client-libraries-cpp/libpulsar-v1.6.2-node-v93-darwin-arm64.tar.gz npm ERR! node-pre-gyp WARN Pre-built binaries not installable for [email protected] and [email protected] (node-v93 ABI, unknown) (falling back to source compile with node-gyp) npm ERR! node-pre-gyp WARN Hit error response status 404 Not Found on https://pulsar.apache.org/docs/en/client-libraries-cpp/libpulsar-v1.6.2-node-v93-darwin-arm64.tar.gz npm ERR! gyp info it worked if it ends with ok npm ERR! gyp info using [email protected] npm ERR! gyp info using [email protected] | darwin | arm64 npm ERR! gyp info ok npm ERR! gyp info it worked if it ends with ok npm ERR! gyp info using [email protected] npm ERR! gyp info using [email protected] | darwin | arm64 npm ERR! gyp info find Python using Python version 3.9.13 found at "/opt/homebrew/opt/[email protected]/bin/python3.9" npm ERR! gyp info spawn /opt/homebrew/opt/[email protected]/bin/python3.9 npm ERR! gyp info spawn args [ npm ERR! gyp info spawn args '/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py', npm ERR! gyp info spawn args 'binding.gyp', npm ERR! gyp info spawn args '-f', npm ERR! gyp info spawn args 'make', npm ERR! gyp info spawn args '-I', npm ERR! gyp info spawn args '/usr/local/lib/node_modules/pulsar-client/build/config.gypi', npm ERR! gyp info spawn args '-I', npm ERR! gyp info spawn args '/usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi', npm ERR! gyp info spawn args '-I', npm ERR! gyp info spawn args '/Users/sarmay/Library/Caches/node-gyp/16.15.1/include/node/common.gypi', npm ERR! gyp info spawn args '-Dlibrary=shared_library', npm ERR! gyp info spawn args '-Dvisibility=default', npm ERR! gyp info spawn args '-Dnode_root_dir=/Users/sarmay/Library/Caches/node-gyp/16.15.1', npm ERR! gyp info spawn args '-Dnode_gyp_dir=/usr/local/lib/node_modules/npm/node_modules/node-gyp', npm ERR! gyp info spawn args '-Dnode_lib_file=/Users/sarmay/Library/Caches/node-gyp/16.15.1/<(target_arch)/node.lib', npm ERR! gyp info spawn args '-Dmodule_root_dir=/usr/local/lib/node_modules/pulsar-client', npm ERR! gyp info spawn args '-Dnode_engine=v8', npm ERR! gyp info spawn args '--depth=.', npm ERR! gyp info spawn args '--no-parallel', npm ERR! gyp info spawn args '--generator-output', npm ERR! gyp info spawn args 'build', npm ERR! gyp info spawn args '-Goutput_dir=.' npm ERR! gyp info spawn args ] npm ERR! gyp info ok npm ERR! gyp info it worked if it ends with ok npm ERR! gyp info using [email protected] npm ERR! gyp info using [email protected] | darwin | arm64 npm ERR! gyp info spawn make npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ] npm ERR! warning: /Library/Developer/CommandLineTools/usr/bin/libtool: archive library: Release/nothing.a the table of contents is empty (no object file members in the library define global symbols) npm ERR! ../src/Consumer.cc:151:7: warning: 'delete' applied to a pointer that was allocated with 'new[]'; did you mean 'delete[]'? [-Wmismatched-new-delete] npm ERR! delete cTopics; npm ERR! ^ npm ERR! [] npm ERR! ../src/Consumer.cc:144:30: note: allocated with 'new[]' here npm ERR! const char **cTopics = new const char *[topics.size()]; npm ERR! ^ npm ERR! ../src/Consumer.cc:180:22: warning: private field 'cConsumer' is not used [-Wunused-private-field] npm ERR! pulsar_consumer_t *cConsumer; npm ERR! ^ npm ERR! 2 warnings generated. npm ERR! ../src/Reader.cc:132:20: warning: private field 'cReader' is not used [-Wunused-private-field] npm ERR! pulsar_reader_t *cReader; npm ERR! ^ npm ERR! 1 warning generated. npm ERR! clang: error: no such file or directory: '/lib/libpulsar.dylib' npm ERR! make: *** [Release/Pulsar.node] Error 1 npm ERR! gyp ERR! build error npm ERR! gyp ERR! stack Error: make failed with exit code: 2 npm ERR! gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23) npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:527:28) npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12) npm ERR! gyp ERR! System Darwin 20.6.0 npm ERR! gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/usr/local/lib/node_modules/pulsar-client/build/Release/libpulsar.node" "--module_name=libpulsar" "--module_path=/usr/local/lib/node_modules/pulsar-client/build/Release" "--napi_version=8" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v93" npm ERR! gyp ERR! cwd /usr/local/lib/node_modules/pulsar-client npm ERR! gyp ERR! node -v v16.15.1 npm ERR! gyp ERR! node-gyp -v v9.0.0 npm ERR! gyp ERR! not ok npm ERR! node-pre-gyp ERR! build error npm ERR! node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/usr/local/lib/node_modules/pulsar-client/build/Release/libpulsar.node --module_name=libpulsar --module_path=/usr/local/lib/node_modules/pulsar-client/build/Release --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v93' (1) npm ERR! node-pre-gyp ERR! stack at ChildProcess. (/usr/local/lib/node_modules/pulsar-client/node_modules/@mapbox/node-pre-gyp/lib/util/compile.js:89:23) npm ERR! node-pre-gyp ERR! stack at ChildProcess.emit (node:events:527:28) npm ERR! node-pre-gyp ERR! stack at maybeClose (node:internal/child_process:1092:16) npm ERR! node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5) npm ERR! node-pre-gyp ERR! System Darwin 20.6.0 npm ERR! node-pre-gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/pulsar-client/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" npm ERR! node-pre-gyp ERR! cwd /usr/local/lib/node_modules/pulsar-client npm ERR! node-pre-gyp ERR! node -v v16.15.1 npm ERR! node-pre-gyp ERR! node-pre-gyp -v v1.0.9 npm ERR! node-pre-gyp ERR! not ok

Sarmay avatar Jul 26 '22 06:07 Sarmay

+1 bump

iTech-dhananjay avatar Jul 28 '22 20:07 iTech-dhananjay

@Sarmay

It seems clang doesn't link to the libpulsar library yet. Please set PULSAR_CPP_DIR environment variable to the libpulsar path like below and execute npm install.

## Apple Silicon and Homebrew since 3.0.0
## cf. https://brew.sh/2021/02/05/homebrew-3.0.0/
$ export PULSAR_CPP_DIR=/opt/homebrew/Cellar/libpulsar/<libpulsar version>

$ npm install

k2la avatar Aug 02 '22 07:08 k2la

I can install this library (1.8.1) on Mac M1 now.

Closing..

Please open a new issue if there is still something not working.

tisonkun avatar Apr 14 '23 09:04 tisonkun