SAP / node-rfc

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

Failed to npm install #126

Closed nygma2004 closed 4 years ago

nygma2004 commented 4 years ago

Dear SAP,

I am trying to install node-rfc on as I would like to communicate with SAP under node-red. I have install Node-Red using snap, and was installing node-rfc like this:

sudo su - cd /root/snap/node-red/current/ node-red.npm install node-rfc

I am seeing the following in the log file:

137 verbose stack Error: node-rfc@1.0.5 install: prebuild-install --tag-prefix -r napi || npm run prebuild 137 verbose stack Exit status 2 137 verbose stack at EventEmitter. (/snap/node-red/538/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16) 137 verbose stack at EventEmitter.emit (events.js:198:13) 137 verbose stack at ChildProcess. (/snap/node-red/538/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14) 137 verbose stack at ChildProcess.emit (events.js:198:13) 137 verbose stack at maybeClose (internal/child_process.js:982:16) 137 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5) 138 verbose pkgid node-rfc@1.0.5 139 verbose cwd /root/snap/node-red/538 140 verbose Linux 4.12.14-122.17-default 141 verbose argv "/snap/node-red/538/bin/node" "/snap/node-red/538/bin/npm" "install" "node-rfc" 142 verbose node v10.19.0 143 verbose npm v6.13.4

I am sorry, my Linux skills are rather limited. The version I am using is:

SUSE Linux Enterprise Server 12 (x86_64) VERSION = 12 PATCHLEVEL = 5

Would you be able to give some advice what I am doing wrong? Cheers, Csongor

bsrdjan commented 4 years ago

Could you please post the output of

$ node -v
$ npm -v

also the full error log, starting with npm install node-rfc

nygma2004 commented 4 years ago

node-rfc-log.txt node-rfc-commandline.txt

Attached the npm log file and the dump from the command line.

node v10.19.0 npm v6.13.4

bsrdjan commented 4 years ago

The node-rfc npm package contains platform dependent binary lib, whose pre-compiled versions are provided for Windows, macOS and Ubuntu Linux. When another target platform detected, the npm installer try to build the binary from source, during install on that platform. That happens in your case and fails because GCC compiler (and possibly more build tools) are missing.

commandline log

ERR! OMG C++ Compiler toolset is not available. Install proper compiler toolset with your package manager, eg. 'sudo apt-get install g++'.

I would recommend to clone the node-rfc repository on your Linux system, install prerequisites and build the package from source, following the documentation. Then install that locally build package. Build from source is recommended for Linux systems anyway.

bsrdjan commented 4 years ago

Could you please try with the latest 1.1.0 version, with deployment dependencies fixed.

nygma2004 commented 4 years ago

I have consulted with a few colleagues and we also run into issues installing the node-red-contrib- saprfc module as well. The snap environment proved too difficult for us to understand how it can be done. Now I have migrated over to a Windows machine. On that I was able to npm install just yesterday without any issues. So this must have been a specific issue with Suse and snap environment. I have not been able to make a connection yet, but I am checking my system settings and user authorisation to role those out first. I think we can close this issue for now.

bsrdjan commented 4 years ago

Sounds good. I just installed and started RED, as a npm module on macOS and also tried node-red-contrib-saprfc, ending with errors. Perhaps to ask the author, posting the issue there?

Please consider that npm install node-rfc works also without SAP NWRFC SDK installed but the SDK is required for node-rfc runtime and must be acquired/installed separately.

nygma2004 commented 4 years ago

I just managed to put a simple flow together and I am getting a "NOT_AUTHORIZED" error. So hopefully I just need to sort out the user access and all the other components/modules are properly installed and working. I am so happy!

nygma2004 commented 4 years ago

Do you happen to know what authorization objects are required for a user to use SAP RFC? Is this documented anywhere? I assume same access as in the GUI for SE37 and execute the test tool, and SE16 to access tables. Anything else that I missed?

bsrdjan commented 4 years ago

The user must be authorised also for RFC calls: https://help.sap.com/doc/saphelp_nwpi711/7.1.1/en-US/48/8d1bd1ae444e6ee10000000a421937/frameset.htm

bsrdjan commented 4 years ago

Please re-open if still active.