SAP / node-rfc

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

Binary Path in Release 0.16 is wrong #85

Closed chforster closed 5 years ago

chforster commented 5 years ago

When performing a "npm install node-rfc" I receive the following Error:

node-pre-gyp ERR! Tried to download(404): https://github.com/sap/node-rfc/releases/download/0.1.16/rfc-v0.1.16-node-v64-linux-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for node-rfc@0.1.16 and node@10.15.3 (node-v64 ABI, glibc) (falling back to source compile with node-gyp)

The Binary Path provided in package.json is not valid anymore. You should take "https://github.com/SAP/node-rfc/releases/tag/" instead of "https://github.com/sap/node-rfc/releases/download/"

bsrdjan commented 5 years ago

Could you please use the node-rfc@next because node-rfc is not supported on node 10.

chforster commented 5 years ago

When using node-rfc@next the npm installworks, but afterwards I receive the following Error:

/home/root/node_modules/node-rfc/lib/wrapper/sapnwrfc-client.js:26
throw ex;
^

Error: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by /home/root/node_modules/node-rfc/lib/binding/linux-x64-node-v64/sapnwrfc.node)
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:730:18)
    at Module.load (internal/modules/cjs/loader.js:600:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
    at Function.Module._load (internal/modules/cjs/loader.js:531:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at Object.<anonymous> (/home/root/node_modules/node-rfc/lib/wrapper/sapnwrfc-client.js:9:15)
    at Module._compile (internal/modules/cjs/loader.js:701:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
    at Module.load (internal/modules/cjs/loader.js:600:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
    at Function.Module._load (internal/modules/cjs/loader.js:531:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at Object.<anonymous> (/home/root/node_modules/node-rfc/lib/index.js:6:10)
    at Module._compile (internal/modules/cjs/loader.js:701:30)
bsrdjan commented 5 years ago

Could you please share the Linux version/release you are using? Is it a docker image and which one?

chforster commented 5 years ago

It's a Docker-Container running on Docker version 18.09.5.

Here's my first draft of the Dockerfile:

FROM node:10-jessie
COPY nwrfcsdk /usr/local/sap/nwrfcsdk
COPY nwrfcsdk.conf /etc/ld.so.conf.d/nwrfcsdk.conf
COPY src/ /home/root/
WORKDIR /home/root
ENV SAPNWRFC_HOME=/usr/local/sap/nwrfcsdk
RUN /sbin/ldconfig
RUN npm install node-rfc@next

The js file I try to execute afterwards is just a connection attempt which worked when using node-rfc (0.16):

var client = new rfc.Client({'user': 'user', 'passwd': 'pwd', 'ashost': '10.0.0.1', 'sysnr': 'x01', 'client': '001'});

client.connect(function(err, res) {  // and connect
  if (err) {  // check for login/connection errors
    return console.error('could not connect to server', err);
  }
bsrdjan commented 5 years ago

docker node images are based on older GLIBC versions and node-rfc must be built from source on them (see #35).

The npm install --build-from-source node-rfc@next should work but for some reason it doesn't. Just tested and need some time to investigate why.

In the meantime, attached sapnwrfc.node should help, just unpack and require('sapnwrfc.node').

bsrdjan commented 5 years ago

npm install node-rfc@next --no-bin-links works now also in node:10-jessie containers.

The --no-bin-links required for now, because of npm issues.

chforster commented 5 years ago

Perfect, thx. Will try it asap. The attached sapnwrfc.node you posted before worked also.

bsrdjan commented 5 years ago

Fixed in rc10.

chforster commented 5 years ago

@bsrdjan : I just tried to install rc10 within my Docker-Container: npm install node-rfc@next --no-bin-link

When calling my connection-function I still receive the error

/root/node_modules/node-rfc/lib/wrapper/sapnwrfc-client.js:16
    throw ex;
    ^

Error: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by /root/node_modules/node-rfc/lib/binding/linux-x64-node-v64/sapnwrfc.node)

 The SAP NW RFC SDK could not be loaded, check the installation: http://sap.github.io/node-rfc/install.html#sap-nw-rfc-sdk-installation
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:730:18)
    at Module.load (internal/modules/cjs/loader.js:600:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
    at Function.Module._load (internal/modules/cjs/loader.js:531:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at Object.<anonymous> (/root/node_modules/node-rfc/lib/wrapper/sapnwrfc-client.js:9:15)
    at Module._compile (internal/modules/cjs/loader.js:701:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
    at Module.load (internal/modules/cjs/loader.js:600:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
    at Function.Module._load (internal/modules/cjs/loader.js:531:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at Object.<anonymous> (/root/node_modules/node-rfc/lib/index.js:6:10)
    at Module._compile (internal/modules/cjs/loader.js:701:30)

When building from source it works npm install --build-from-source node-rfc@next

bsrdjan commented 5 years ago

The node-rfc Linux addon is built on ubuntu based docker image, using GLIBC version 2.27. Docker node images are still using older GLIBC versions (see comment of #35) and the build from source is therefore required.