You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/06/16 08:59:33 UTC

[GitHub] [pulsar-client-node] nearzxide10 commented on issue #87: npm install fails on MacOS

nearzxide10 commented on issue #87:
URL: https://github.com/apache/pulsar-client-node/issues/87#issuecomment-1157411697

   nodeJs version : 16.15.1
   npm  version : 8.11.0
   mac OS: 12.4 (M1 max)
   
    I installed the cpp client first and export PULSAR_CPP_DIR..  can't npm install too
   
   ```
   npm ERR! code 1
   npm ERR! path /Users/jackliu/Project/pulsar/pulsar_test/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-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 '/Users/jackliu/.nvm/versions/node/v16.15.1/bin/node /Users/jackliu/.nvm/versions/node/v16.15.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/Users/jackliu/Project/pulsar/pulsar_test/node_modules/pulsar-client/build/Release/libpulsar.node --module_name=libpulsar --module_path=/Users/jackliu/Project/pulsar/pulsar_test/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 node-pre-gyp@1.0.9
   npm ERR! node-pre-gyp info using node@16.15.1 | darwin | arm64
   npm ERR! node-pre-gyp info check checked for "/Users/jackliu/Project/pulsar/pulsar_test/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 pulsar-client@1.6.2 and node@16.15.1 (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 node-gyp@9.0.0
   npm ERR! gyp info using node@16.15.1 | darwin | arm64
   npm ERR! gyp info ok
   npm ERR! gyp info it worked if it ends with ok
   npm ERR! gyp info using node-gyp@9.0.0
   npm ERR! gyp info using node@16.15.1 | darwin | arm64
   npm ERR! gyp info find Python using Python version 3.9.13 found at "/opt/homebrew/opt/python@3.9/bin/python3.9"
   npm ERR! gyp info spawn /opt/homebrew/opt/python@3.9/bin/python3.9
   npm ERR! gyp info spawn args [
   npm ERR! gyp info spawn args   '/Users/jackliu/.nvm/versions/node/v16.15.1/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   '/Users/jackliu/Project/pulsar/pulsar_test/node_modules/pulsar-client/build/config.gypi',
   npm ERR! gyp info spawn args   '-I',
   npm ERR! gyp info spawn args   '/Users/jackliu/.nvm/versions/node/v16.15.1/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
   npm ERR! gyp info spawn args   '-I',
   npm ERR! gyp info spawn args   '/Users/jackliu/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/jackliu/Library/Caches/node-gyp/16.15.1',
   npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/Users/jackliu/.nvm/versions/node/v16.15.1/lib/node_modules/npm/node_modules/node-gyp',
   npm ERR! gyp info spawn args   '-Dnode_lib_file=/Users/jackliu/Library/Caches/node-gyp/16.15.1/<(target_arch)/node.lib',
   npm ERR! gyp info spawn args   '-Dmodule_root_dir=/Users/jackliu/Project/pulsar/pulsar_test/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 node-gyp@9.0.0
   npm ERR! gyp info using node@16.15.1 | 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! In file included from ../src/addon.cc:23:
   npm ERR! In file included from ../src/Producer.h:24:
   npm ERR! In file included from /opt/homebrew/Cellar/libpulsar/2.10.0/include/pulsar/c/client.h:23:
   npm ERR! /opt/homebrew/Cellar/libpulsar/2.10.0/include/pulsar/c/client_configuration.h:162:15: warning: 'const' type qualifier on return type has no effect [-Wignored-qualifiers]
   npm ERR! PULSAR_PUBLIC const unsigned int pulsar_client_configuration_get_stats_interval_in_seconds(
   npm ERR!               ^~~~~~
   npm ERR! 1 warning generated.
   npm ERR! In file included from ../src/Client.cc:20:
   npm ERR! In file included from ../src/Client.h:24:
   npm ERR! In file included from /opt/homebrew/Cellar/libpulsar/2.10.0/include/pulsar/c/client.h:23:
   npm ERR! /opt/homebrew/Cellar/libpulsar/2.10.0/include/pulsar/c/client_configuration.h:162:15: warning: 'const' type qualifier on return type has no effect [-Wignored-qualifiers]
   npm ERR! PULSAR_PUBLIC const unsigned int pulsar_client_configuration_get_stats_interval_in_seconds(
   npm ERR!               ^~~~~~
   npm ERR! 1 warning generated.
   npm ERR! In file included from ../src/Producer.cc:20:
   npm ERR! In file included from ../src/Producer.h:24:
   npm ERR! In file included from /opt/homebrew/Cellar/libpulsar/2.10.0/include/pulsar/c/client.h:23:
   npm ERR! /opt/homebrew/Cellar/libpulsar/2.10.0/include/pulsar/c/client_configuration.h:162:15: warning: 'const' type qualifier on return type has no effect [-Wignored-qualifiers]
   npm ERR! PULSAR_PUBLIC const unsigned int pulsar_client_configuration_get_stats_interval_in_seconds(
   npm ERR!               ^~~~~~
   npm ERR! 1 warning generated.
   npm ERR! In file included from ../src/Consumer.cc:20:
   npm ERR! In file included from ../src/Consumer.h:24:
   npm ERR! In file included from /opt/homebrew/Cellar/libpulsar/2.10.0/include/pulsar/c/client.h:23:
   npm ERR! /opt/homebrew/Cellar/libpulsar/2.10.0/include/pulsar/c/client_configuration.h:162:15: warning: 'const' type qualifier on return type has no effect [-Wignored-qualifiers]
   npm ERR! PULSAR_PUBLIC const unsigned int pulsar_client_configuration_get_stats_interval_in_seconds(
   npm ERR!               ^~~~~~
   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! 3 warnings generated.
   npm ERR! In file included from ../src/ConsumerConfig.cc:20:
   npm ERR! In file included from ../src/ConsumerConfig.h:24:
   npm ERR! In file included from ../src/MessageListener.h:24:
   npm ERR! In file included from /opt/homebrew/Cellar/libpulsar/2.10.0/include/pulsar/c/client.h:23:
   npm ERR! /opt/homebrew/Cellar/libpulsar/2.10.0/include/pulsar/c/client_configuration.h:162:15: warning: 'const' type qualifier on return type has no effect [-Wignored-qualifiers]
   npm ERR! PULSAR_PUBLIC const unsigned int pulsar_client_configuration_get_stats_interval_in_seconds(
   npm ERR!               ^~~~~~
   npm ERR! 1 warning generated.
   npm ERR! In file included from ../src/Reader.cc:21:
   npm ERR! In file included from ../src/Reader.h:24:
   npm ERR! In file included from /opt/homebrew/Cellar/libpulsar/2.10.0/include/pulsar/c/client.h:23:
   npm ERR! /opt/homebrew/Cellar/libpulsar/2.10.0/include/pulsar/c/client_configuration.h:162:15: warning: 'const' type qualifier on return type has no effect [-Wignored-qualifiers]
   npm ERR! PULSAR_PUBLIC const unsigned int pulsar_client_configuration_get_stats_interval_in_seconds(
   npm ERR!               ^~~~~~
   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! 2 warnings generated.
   npm ERR! In file included from ../src/ReaderConfig.cc:20:
   npm ERR! In file included from ../src/ReaderConfig.h:27:
   npm ERR! In file included from ../src/ReaderListener.h:24:
   npm ERR! In file included from /opt/homebrew/Cellar/libpulsar/2.10.0/include/pulsar/c/client.h:23:
   npm ERR! /opt/homebrew/Cellar/libpulsar/2.10.0/include/pulsar/c/client_configuration.h:162:15: warning: 'const' type qualifier on return type has no effect [-Wignored-qualifiers]
   npm ERR! PULSAR_PUBLIC const unsigned int pulsar_client_configuration_get_stats_interval_in_seconds(
   npm ERR!               ^~~~~~
   npm ERR! 1 warning generated.
   npm ERR! ld: library not found for -lpulsar
   npm ERR! clang: error: linker command failed with exit code 1 (use -v to see invocation)
   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 (/Users/jackliu/.nvm/versions/node/v16.15.1/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 21.5.0
   npm ERR! gyp ERR! command "/Users/jackliu/.nvm/versions/node/v16.15.1/bin/node" "/Users/jackliu/.nvm/versions/node/v16.15.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/Users/jackliu/Project/pulsar/pulsar_test/node_modules/pulsar-client/build/Release/libpulsar.node" "--module_name=libpulsar" "--module_path=/Users/jackliu/Project/pulsar/pulsar_test/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 /Users/jackliu/Project/pulsar/pulsar_test/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 '/Users/jackliu/.nvm/versions/node/v16.15.1/bin/node /Users/jackliu/.nvm/versions/node/v16.15.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/Users/jackliu/Project/pulsar/pulsar_test/node_modules/pulsar-client/build/Release/libpulsar.node --module_name=libpulsar --module_path=/Users/jackliu/Project/pulsar/pulsar_test/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.<anonymous> (/Users/jackliu/Project/pulsar/pulsar_test/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 21.5.0
   npm ERR! node-pre-gyp ERR! command "/Users/jackliu/.nvm/versions/node/v16.15.1/bin/node" "/Users/jackliu/Project/pulsar/pulsar_test/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
   npm ERR! node-pre-gyp ERR! cwd /Users/jackliu/Project/pulsar/pulsar_test/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
   
   npm ERR! A complete log of this run can be found in:
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org