Blizzard / node-rdkafka

Node.js bindings for librdkafka
MIT License
2.08k stars 391 forks source link

installation gives an error "cp: illegal option -- -" on Mac #1043

Closed atikatantiya closed 9 months ago

atikatantiya commented 9 months ago

Environment Information

Steps to Reproduce

Installing node-rdkafka gives this error on Mac but not on Linux.

Creating shared library librdkafka.1.dylib
│ gcc -L/Users/I538722/SAPDevelop/ONEmasterdata/common/temp/node_modules/.pnpm/node-rdkafka@2.17.0_patch_hash=v262ath6md5t5way3vkesepy4m/node_modules/node-rdkafka/build/deps -shared -dynamiclib -Wl,-install_name,/U…
│ cp librdkafka.1.dylib librdkafka-dbg.1.dylib
│ Creating static library librdkafka.a
│ ar rcs librdkafka.a rdkafka.o rdkafka_broker.o rdkafka_msg.o rdkafka_topic.o rdkafka_conf.o rdkafka_timer.o rdkafka_offset.o rdkafka_transport.o rdkafka_buf.o rdkafka_queue.o rdkafka_op.o rdkafka_request.o rdkafk…
│ cp --remove-destination librdkafka.a librdkafka-dbg.a
│ cp: illegal option -- -
│ usage: cp [-R [-H | -L | -P]] [-fi | -n] [-aclpSsvXx] source_file target_file
│        cp [-R [-H | -L | -P]] [-fi | -n] [-aclpSsvXx] source_file ... target_directory
│ make[2]: *** [librdkafka.a] Error 64
│ make[1]: *** [libs] Error 2
│ make: *** [11a9e3388a67e1ca5c31c1d8da49cb6d2714eb41.intermediate] Error 2
│ rm 11a9e3388a67e1ca5c31c1d8da49cb6d2714eb41.intermediate
│ gyp ERR! build error 
│ gyp ERR! stack Error: `make` failed with exit code: 2
│ gyp ERR! stack     at ChildProcess.onExit (/Users/I538722/.rush/node-v18.18.0/pnpm-8.6.9/node_modules/pnpm/dist/node_modules/node-gyp/lib/build.js:203:23)
│ gyp ERR! stack     at ChildProcess.emit (node:events:517:28)
│ gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:292:12)
│ gyp ERR! System Darwin 23.0.0
│ gyp ERR! command "/Users/I538722/.nvm/versions/node/v18.18.0/bin/node" "/Users/I538722/.rush/node-v18.18.0/pnpm-8.6.9/node_modules/pnpm/dist/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
│ gyp ERR! cwd /Users/I538722/SAPDevelop/ONEmasterdata/common/temp/node_modules/.pnpm/node-rdkafka@2.17.0_patch_hash=v262ath6md5t5way3vkesepy4m/node_modules/node-rdkafka
│ gyp ERR! node -v v18.18.0
│ gyp ERR! node-gyp -v v9.4.0
│ gyp ERR! not ok 
└─ Failed in 1m 18.9s at /Users/I538722/SAPDevelop/ONEmasterdata/common/temp/node_modules/.pnpm/node-rdkafka@2.17.0_patch_hash=v262ath6md5t5way3vkesepy4m/node_modules/node-rdkafka
node_modules/.pnpm/re2@1.19.1_patch_hash=a6iq6jt5fok7uctkv4e6xtmxyq/node_modules/re2: Running install script...
 ELIFECYCLE  Command failed with exit code 1.

Please help with how I can fix this.