SAP / node-rfc

Asynchronous, non-blocking SAP NW RFC SDK bindings for Node.js
Apache License 2.0
252 stars 74 forks source link

node-rfc installation not working #319

Closed rman-99 closed 10 months ago

rman-99 commented 10 months ago

I am reaching out to seek assistance regarding compatibility issues I am facing with my Node.js application and the nwrfcsdk.

Successful Configurations: Windows/Linux/Node v18 + node-rfc 2.5.1 + nwrfc750P_10-70002761.zip Windows/Node v20 + node-rfc 3.3.1 + nwrfc750P_10-70002761.zip

Challenges Encountered: Linux/Node18 + node-rfc 3.3.1 + nwrfc750P_10-70002761.zip Linux/Node18 + node-rfc 3.3.1 + nwrfc750P_12-70002752.zip

In addition to this, we have attempted to use the latest version of node-pre-gyp. Below is the error we are receiving while attempting npm install.

[2024-01-17T12:02:29.207Z] npm ERR! code 1 [2024-01-17T12:02:29.207Z] npm ERR! path /app/node_modules/node-rfc [2024-01-17T12:02:29.207Z] npm ERR! command failed [2024-01-17T12:02:29.207Z] npm ERR! command sh -c node-gyp-build [2024-01-17T12:02:29.207Z] npm ERR! make: Entering directory '/app/node_modules/node-rfc/build' [2024-01-17T12:02:29.207Z] npm ERR! CXX(target) Release/obj.target/sapnwrfc/src/cpp/addon.o [2024-01-17T12:02:29.207Z] npm ERR! make: Leaving directory '/app/node_modules/node-rfc/build' [2024-01-17T12:02:29.207Z] npm ERR! gyp info it worked if it ends with ok [2024-01-17T12:02:29.207Z] npm ERR! gyp info using node-gyp@9.3.1 [2024-01-17T12:02:29.207Z] npm ERR! gyp info using node@18.17.1 | linux | x64 [2024-01-17T12:02:29.207Z] npm ERR! gyp info find Python using Python version 3.9.2 found at "/usr/bin/python3" [2024-01-17T12:02:29.207Z] npm ERR! gyp http GET https://nodejs.org/download/release/v18.17.1/node-v18.17.1-headers.tar.gz [2024-01-17T12:02:29.207Z] npm ERR! gyp http 200 https://nodejs.org/download/release/v18.17.1/node-v18.17.1-headers.tar.gz [2024-01-17T12:02:29.207Z] npm ERR! gyp http GET https://nodejs.org/download/release/v18.17.1/SHASUMS256.txt [2024-01-17T12:02:29.207Z] npm ERR! gyp http 200 https://nodejs.org/download/release/v18.17.1/SHASUMS256.txt [2024-01-17T12:02:29.207Z] npm ERR! gyp info spawn /usr/bin/python3 [2024-01-17T12:02:29.207Z] npm ERR! gyp info spawn args [ [2024-01-17T12:02:29.207Z] npm ERR! gyp info spawn args '/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py', [2024-01-17T12:02:29.207Z] npm ERR! gyp info spawn args 'binding.gyp', [2024-01-17T12:02:29.207Z] npm ERR! gyp info spawn args '-f', [2024-01-17T12:02:29.208Z] npm ERR! gyp info spawn args 'make', [2024-01-17T12:02:29.208Z] npm ERR! gyp info spawn args '-I', [2024-01-17T12:02:29.208Z] npm ERR! gyp info spawn args '/app/node_modules/node-rfc/build/config.gypi', [2024-01-17T12:02:29.208Z] npm ERR! gyp info spawn args '-I', [2024-01-17T12:02:29.208Z] npm ERR! gyp info spawn args '/usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi', [2024-01-17T12:02:29.208Z] npm ERR! gyp info spawn args '-I', [2024-01-17T12:02:29.208Z] npm ERR! gyp info spawn args '/home/node/.cache/node-gyp/18.17.1/include/node/common.gypi', [2024-01-17T12:02:29.208Z] npm ERR! gyp info spawn args '-Dlibrary=shared_library', [2024-01-17T12:02:29.208Z] npm ERR! gyp info spawn args '-Dvisibility=default', [2024-01-17T12:02:29.208Z] npm ERR! gyp info spawn args '-Dnode_root_dir=/home/node/.cache/node-gyp/18.17.1', [2024-01-17T12:02:29.208Z] npm ERR! gyp info spawn args '-Dnode_gyp_dir=/usr/local/lib/node_modules/npm/node_modules/node-gyp', [2024-01-17T12:02:29.208Z] npm ERR! gyp info spawn args '-Dnode_lib_file=/home/node/.cache/node-gyp/18.17.1/<(target_arch)/node.lib', [2024-01-17T12:02:29.208Z] npm ERR! gyp info spawn args '-Dmodule_root_dir=/app/node_modules/node-rfc', [2024-01-17T12:02:29.208Z] npm ERR! gyp info spawn args '-Dnode_engine=v8', [2024-01-17T12:02:29.208Z] npm ERR! gyp info spawn args '--depth=.', [2024-01-17T12:02:29.208Z] npm ERR! gyp info spawn args '--no-parallel', [2024-01-17T12:02:29.208Z] npm ERR! gyp info spawn args '--generator-output', [2024-01-17T12:02:29.208Z] npm ERR! gyp info spawn args 'build', [2024-01-17T12:02:29.208Z] npm ERR! gyp info spawn args '-Goutput_dir=.' [2024-01-17T12:02:29.208Z] npm ERR! gyp info spawn args ] [2024-01-17T12:02:29.208Z] npm ERR! gyp info spawn make [2024-01-17T12:02:29.208Z] npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ] [2024-01-17T12:02:29.208Z] npm ERR! In file included from ../src/cpp/Log.h:12, [2024-01-17T12:02:29.208Z] npm ERR! from ../src/cpp/Client.h:8, [2024-01-17T12:02:29.208Z] npm ERR! from ../src/cpp/addon.cc:5: [2024-01-17T12:02:29.208Z] npm ERR! ../src/cpp/noderfc.h:9:10: fatal error: sapnwrfc.h: No such file or directory [2024-01-17T12:02:29.208Z] npm ERR! 9 | #include [2024-01-17T12:02:29.208Z] npm ERR! | ^~~~ [2024-01-17T12:02:29.208Z] npm ERR! compilation terminated. [2024-01-17T12:02:29.208Z] npm ERR! make: *** [sapnwrfc.target.mk:161: Release/obj.target/sapnwrfc/src/cpp/addon.o] Error 1 [2024-01-17T12:02:29.208Z] npm ERR! gyp ERR! build error [2024-01-17T12:02:29.208Z] npm ERR! gyp ERR! stack Error: make failed with exit code: 2 [2024-01-17T12:02:29.208Z] npm ERR! gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:203:23) [2024-01-17T12:02:29.208Z] npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:514:28) [2024-01-17T12:02:29.208Z] npm ERR! gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:291:12) [2024-01-17T12:02:29.208Z] npm ERR! gyp ERR! System Linux 5.10.205-195.804.amzn2.x86_64 [2024-01-17T12:02:29.208Z] npm ERR! gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" [2024-01-17T12:02:29.208Z] npm ERR! gyp ERR! cwd /app/node_modules/node-rfc [2024-01-17T12:02:29.208Z] npm ERR! gyp ERR! node -v v18.17.1 [2024-01-17T12:02:29.208Z] npm ERR! gyp ERR! node-gyp -v v9.3.1 [2024-01-17T12:02:29.208Z] npm ERR! gyp ERR! not ok

I also tried setting the ENV Variables pointing to root folder - /home/myusername/nwrfcsdk

bsrdjan commented 10 months ago

Which Linux distribution / release is used?

Can you post the output of

tree $SAPNWRFC_HOME

and of

cd $SAPNWRFC_HOME/bin
./startrfc -v
rman-99 commented 10 months ago

cd $SAPNWRFC_HOME/bin, this helped as it was pointing to the wrong directory. After the change, it worked. Thanks for the support, cheers!